src/makefile.w32-in: Update dependencies.
[emacs.git] / src / ChangeLog
blobe741432a9c4d338c12ad75a7c3261f523914e71c
1 2013-03-29  Juanma Barranquero  <lekktu@gmail.com>
3         * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
4         Update dependencies.
6 2013-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
8         * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
9         (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
10         forward references.
12 2013-03-28  Dmitry Antipov  <dmantipov@yandex.ru>
14         * window.h (struct window): Replace hchild, vchild and buffer slots
15         with the only contents slot.  This is possible because each valid
16         window may have either the child window (in vertical or horizontal
17         combination) or buffer to display (for the leaf window).  Using that,
18         a lof of operations to traverse and/or change window hierarchies may
19         be simplified.  New member horizontal is used to distinguish between
20         horizontal and vertical combinations of internal windows.
21         (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
22         (WINDOW_VERTICAL_COMBINATION_P): New macros.
23         (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
24         * window.c (wset_hchild, wset_vchild): Remove.  Adjust all users.
25         Use contents slot, not buffer, where appropriate.
26         (wset_combination): New function.
27         (wset_buffer): Add eassert.
28         (Fframe_first_window): Simplify the loop reaching first window.
29         (Fwindow_buffer): Use WINDOW_LEAF_P.
30         (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
31         (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
32         (unshow_buffer): Convert initial debugging check to eassert.
33         (replace_window, recombine_windows, Fdelete_other_windows_internal)
34         (make_parent_window, window_resize_check, window_resize_apply)
35         (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
36         (Fset_window_configuration, delete_all_child_windows, save_window_save):
37         Adjust to match struct window changes.
38         (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
39         (mark_window_cursors_off, count_windows, get_leaf_windows)
40         (foreach_window_1): Simplify the loop.
41         * alloc.c (mark_object): Do not check for the leaf window because
42         internal windows has no glyph matrices anyway.
43         * dispnew.c (clear_window_matrices, showing_window_margins_p)
44         (allocate_matrices_for_window_redisplay, fake_current_matrices)
45         (allocate_matrices_for_frame_redisplay, free_window_matrices)
46         (build_frame_matrix_from_window_tree, mirror_make_current)
47         (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
48         (update_window_tree, set_window_update_flags): Simplify the loop.
49         (sync_window_with_frame_matrix_rows): Enforce live window.
50         Use contents slot, not buffer, where appropriate.
51         * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
52         and WINDOW_HORIZONTAL_COMBINATION_P.
53         (make_frame_visible_1): Simplify the loop.
54         Use contents slot, not buffer, where appropriate.
55         * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
56         (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
57         (expose_window_tree): Likewise.
58         Use contents slot, not buffer, where appropriate.
59         * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
60         to avoid deleted windows.  Use contents slot instead of buffer.
61         * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
62         * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
63         * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
64         * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
66 2013-03-28  Eli Zaretskii  <eliz@gnu.org>
68         * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
69         identify the reasons for assertion violations in bug#14062 and
70         similar ones.
71         (Fx_show_tip): Fix compilation error under
72         "--enable-check-lisp-object-type".  (Bug#14073)
74         * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
75         Reported by <rzl24ozi@gmail.com>.
77 2013-03-28  Dmitry Antipov  <dmantipov@yandex.ru>
79         * xdisp.c (with_echo_area_buffer_unwind_data): Save window
80         start marker...
81         (unwind_with_echo_area_buffer): ...to restore it here.  This
82         is needed to ensure that...
83         (redisplay_window): ...both window markers are valid here,
84         which is verified by eassert.
85         * editfns.c (save_excursion_save): Do not assume that
86         selected_window always displays the buffer.
87         * buffer.c (Fbuffer_swap_text): Adjust window start markers.
88         Fix comment.
90 2013-03-27  Stefan Monnier  <monnier@iro.umontreal.ca>
92         * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
93         the upcase table.
95 2013-03-27  rzl24ozi  <rzl24ozi@gmail.com>  (tiny changes)
97         * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
99 2013-03-27  Eli Zaretskii  <eliz@gnu.org>
101         * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
102         since MinGW's w32api headers do.  This avoids compiler warnings.
104         * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
105         if already defined.
107 2013-03-26  Eli Zaretskii  <eliz@gnu.org>
109         * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
111 2013-03-26  Jan Djärv  <jan.h.d@swipnet.se>
113         * gtkutil.c (style_changed_cb): Check if frame is live and an
114         X frame (Bug#14038).
116 2013-03-26  Eli Zaretskii  <eliz@gnu.org>
118         * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
119         Define only for _WIN32_WINNT less than 0x0500.
120         (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
121         MinGW64.
122         Move inclusion of time.h before sys/time.h, so that MinGW64 could
123         see its own definitions of 'struct timeval' and 'struct timezone'.
125         Fix incompatibilities between MinGW.org and MinGW64 headers.
126         * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
128         * w32.c (REPARSE_DATA_BUFFER): Guard with
129         MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
131 2013-03-25  Jan Djärv  <jan.h.d@swipnet.se>
133         * xterm.c: Include X11/XKBlib.h
134         (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
136 2013-03-24  Andreas Schwab  <schwab@linux-m68k.org>
138         * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
139         written backwards.
140         * blockinput.h (input_blocked_p): Likewise.
141         * bytecode.c (exec_byte_code): Likewise.
142         * callproc.c (call_process_kill, call_process_cleanup)
143         (Fcall_process): Likewise.
144         * ccl.c (ccl_driver, resolve_symbol_ccl_program)
145         (Fccl_execute_on_string): Likewise.
146         * character.c (string_escape_byte8): Likewise.
147         * charset.c (read_hex): Likewise.
148         * cm.c (calccost): Likewise.
149         * data.c (cons_to_unsigned): Likewise.
150         * dired.c (directory_files_internal, file_name_completion):
151         Likewise.
152         * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
153         (sit_for): Likewise.
154         * doc.c (Fsubstitute_command_keys): Likewise.
155         * doprnt.c (doprnt): Likewise.
156         * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
157         * emacsgtkfixed.c: Likewise.
158         * fileio.c (file_offset, Fwrite_region): Likewise.
159         * floatfns.c (Fexpt, fmod_float): Likewise.
160         * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
161         Likewise.
162         * font.c (font_intern_prop): Likewise.
163         * frame.c (x_set_alpha): Likewise.
164         * gtkutil.c (get_utf8_string): Likewise.
165         * indent.c (check_display_width): Likewise.
166         * intervals.c (create_root_interval, rotate_right, rotate_left)
167         (split_interval_right, split_interval_left)
168         (adjust_intervals_for_insertion, delete_node)
169         (interval_deletion_adjustment, adjust_intervals_for_deletion)
170         (merge_interval_right, merge_interval_left, copy_intervals)
171         (set_intervals_multibyte_1): Likewise.
172         * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
173         * keymap.c (Fkey_description): Likewise.
174         * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
175         * lread.c (openp, read_integer, read1, string_to_number):
176         Likewise.
177         * menu.c (ensure_menu_items): Likewise.
178         * minibuf.c (read_minibuf_noninteractive): Likewise.
179         * print.c (printchar, strout): Likewise.
180         * process.c (create_process, Faccept_process_output)
181         (wait_reading_process_output, read_process_output, send_process)
182         (wait_reading_process_output): Likewise.
183         * profiler.c (make_log, handle_profiler_signal): Likewise.
184         * regex.c (re_exec): Likewise.
185         * regex.h: Likewise.
186         * search.c (looking_at_1, Freplace_match): Likewise.
187         * sysdep.c (get_child_status, procfs_ttyname)
188         (procfs_get_total_memory): Likewise.
189         * systime.h (EMACS_TIME_VALID_P): Likewise.
190         * term.c (dissociate_if_controlling_tty): Likewise.
191         * window.c (get_phys_cursor_glyph): Likewise.
192         * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
193         (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
194         Likewise.
195         * xfns.c (Fx_window_property): Likewise.
196         * xmenu.c (set_frame_menubar): Likewise.
197         * xselect.c (x_get_window_property, x_handle_dnd_message):
198         Likewise.
199         * xsmfns.c (smc_save_yourself_CB): Likewise.
200         * xterm.c (x_scroll_bar_set_handle): Likewise.
202 2013-03-24  Dmitry Antipov  <dmantipov@yandex.ru>
204         * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
205         to be optional or nil.  Adjust comment and convert it to docstring.
206         * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
207         * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
209 2013-03-24  Paul Eggert  <eggert@cs.ucla.edu>
211         Static checking by GCC 4.8-20130319.
212         * image.c (gif_load): Assume pass < 3 to pacify GCC.
213         * process.c (Fset_process_datagram_address)
214         (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
215         * xdisp.c (get_char_face_and_encoding):
216         (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
217         (get_glyph_face_and_encoding): Prepare face before possibly using it.
218         (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
220 2013-03-24  Ken Brown  <kbrown@cornell.edu>
222         * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
223         fix compilation on 64-bit Cygwin, where underscores are not
224         automatically prepended.
226         * w32term.c (w32_initialize): Silence compiler warning.
228 2013-03-23  Eli Zaretskii  <eliz@gnu.org>
230         * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
231         FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
232         variables, to save and restore frame dimensions.  Use
233         FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
234         after returning from a 'fullscreen' configuration.  use
235         SendMessage instead of PostMessage to send the SC_RESTORE message,
236         to avoid races between the main thread and the input thread.
238         * w32term.h (struct w32_output): New members normal_width,
239         normal_height, normal_top, normal_left, and prev_fsmode.
240         (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
241         (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
242         members of a frame.
244         * w32term.c (w32fullscreen_hook): Record last value of the frame's
245         'fullscreen' parameter.  Always record previous width and height
246         of the frame, except when switching out of maximized modes, so
247         that they could be restored correctly, instead of resetting to the
248         default frame dimensions.  Send SC_RESTORE command to the frame,
249         unless we are going to send SC_MAXIMIZE, to restore the frame
250         resize hints in the mouse pointer shown by the window manager.
251         (Bug#14032)
253         * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
255         * lisp.h (get_frame_param): Adjust conditions for prototype
256         declaration.
258 2013-03-22  Ken Brown  <kbrown@cornell.edu>
260         * unexcw.c: Drop unneeded inclusion of w32common.h.
261         (report_sheap_usage): Declare.
262         (read_exe_header): Add magic numbers for x86_64.
263         (fixup_executable): Fix printf format specifier for unsigned long
264         argument.
266 2013-03-22  Dmitry Antipov  <dmantipov@yandex.ru>
268         * frame.h (struct frame): Put menu_bar_window under #ifdef
269         because this member is not needed when X toolkit is in use.
270         (fset_menu_bar_window):
271         * dispnew.c (clear_current_matrices, clear_desired_matrices)
272         (free_glyphs, update_frame):
273         * xdisp.c (expose_frame): Likewise.
274         (display_menu_bar): Likewise.  Remove redundant eassert.
275         * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
276         toolkit is in use.
278 2013-03-21  Paul Eggert  <eggert@cs.ucla.edu>
280         Use functions and constants to manipulate Lisp_Save_Value objects.
281         This replaces code that used macros and strings and token-pasting.
282         The change makes the C source a bit easier to follow,
283         and shrinks the Emacs executable a bit.
284         * alloc.c: Verify some properties of Lisp_Save_Value's representation.
285         (make_save_value): Change 1st arg from string to enum.  All callers
286         changed.
287         (INTX): Remove.
288         (mark_object): Use if, not #if, for GC_MARK_STACK.
289         * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
290         (XSAVE_OBJECT): Now functions, not macros.
291         (STRING_BYTES_BOUND): Now just a macro, not a constant too;
292         the constant was never used.
293         (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
294         (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
295         (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
296         (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
297         New constants.
298         (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
299         type3 with a single member save_type.  All uses changed.
300         (save_type, set_save_pointer, set_save_integer): New functions.
301         * print.c (PRINTX): Remove.
303         * alloc.c: Remove redundant static declarations.
305 2013-03-20  Dmitry Antipov  <dmantipov@yandex.ru>
307         * window.h (struct window): Convert left_col, top_line, total_lines
308         and total_cols from Lisp_Objects to integers.  Adjust comments.
309         (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
310         Remove.
311         (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
312         (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
313         * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
314         Adjust users where appropriate.
316 2013-03-20  Dmitry Antipov  <dmantipov@yandex.ru>
318         * frame.h (struct frame): Drop resx and resy because the same data is
319         available from window system-specific output context.  Adjust users.
320         (default_pixels_per_inch_x, default_pixels_per_inch_y): New
321         functions to provide defaults when no window system available.
322         (FRAME_RES_X, FRAME_RES_Y): New macros.
323         (NUMVAL): Moved from xdisp.c.
324         * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
325         (Ffont_face_attributes, Fopen_font):
326         * image.c (gs_load):
327         * w32font.c (fill_in_logfont):
328         * xdisp.c (calc_pixel_width_or_height):
329         * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
330         * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
332 2013-03-20  Kenichi Handa  <handa@gnu.org>
334         * coding.c (syms_of_coding): Initialize disable_ascii_optimization
335         to 1 (temporary workaround until a bug related to ASCII
336         optimization is fixed).
338 2013-03-19  Dmitry Antipov  <dmantipov@yandex.ru>
340         * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
341         Signal error if window is not internal.  Adjust docstring.
342         (delete_all_child_windows): Use combination_limit to save the buffer.
343         (Fset_window_configuration): Adjust accordingly.
344         * print.c (syms_of_print): Initialize debugging output not here...
345         (init_print_once): ...but in a new function here.
346         * lisp.h (init_print_once): Add prototype.
347         * emacs.c (main): Add call to init_print_once.  Adjust comments.
349 2013-03-18  Dmitry Antipov  <dmantipov@yandex.ru>
351         * window.c (window_resize_check, window_resize_apply)
352         (window_from_coordinates, recombine_windows, set_window_buffer)
353         (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
354         (Fsplit_window_internal, Fdelete_window_internal)
355         (freeze_window_starts): Use bool for booleans.
356         * window.h (window_frame_coordinates, resize_frame_windows)
357         (freeze_window_starts, set_window_buffer): Adjust prototypes.
359 2013-03-17  Stefan Monnier  <monnier@iro.umontreal.ca>
361         * dispnew.c (bitch_at_user): Use `user-error'.
363 2013-03-17  Ken Brown  <kbrown@cornell.edu>
365         * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c.  Use it
366         as return type of image_background.  (Bug#13981)
367         * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
369 2013-03-16  Jan Djärv  <jan.h.d@swipnet.se>
371         * nsterm.m (updateFrameSize:): Change resize increments if needed.
372         (ns_select): Don't return with result uninitialized.
374         * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
375         and getDirectory.
377         * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
378         New functions.
379         (Fns_read_file_name): ret is BOOL.  If ! dir_only_p, don't choose
380         directories.  If filename is nil, get directory name (Bug#13932).
381         Use getFilename and getDirectory.
382         (getFilename, getDirectory): New methods for EmacsSavePanel and
383         EmacsOpenPanel.
384         (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
386 2013-03-15  Paul Eggert  <eggert@cs.ucla.edu>
388         * coding.c (decode_coding_gap): Fix typo caught by static checking.
390 2013-03-15  handa  <handa@gnu.org>
392         * insdel.c (insert_from_gap): New arg text_at_gap_tail.
393         (adjust_after_replace): Make it back to static.  Delete the third
394         arg text_at_gap_tail.  Cancel the code for handling it.
396         * coding.h (struct coding_system): New member eol_seen.
398         * coding.c (detect_ascii): New function.
399         (detect_coding): Set coding->head_ascii and coding->eol_seen only
400         when the source bytes are actually scanned.  On detecting for
401         coding_category_utf_8_auto, call detect_ascii instead of scanning
402         source bytes directly.
403         (produce_chars): Call insert_from_gap with the new arg 0.
404         (encode_coding): Likewise.
405         (decode_coding_gap): Control ASCII optimization by the variable
406         disable_ascii_optimization instead of #ifndef .. #endif.
407         Deccode EOL format according to coding->eol_seen.
408         (syms_of_coding): Declare disable-ascii-optimization as a Lisp
409         variable.
411         * lisp.h (adjust_after_replace): Cancel externing it.
412         (insert_from_gap): Adjust prototype.
414 2013-03-15  Eli Zaretskii  <eliz@gnu.org>
416         * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
417         FULLSCREEN_MAXIMIZED.  (Bug#13935)
419 2013-03-15  Dmitry Antipov  <dmantipov@yandex.ru>
421         * region-cache.c (find_cache_boundary, move_cache_gap)
422         (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
423         Simplify debugging check and convert to eassert.  Adjust comment.
424         (pp_cache): Put under ENABLE_CHECKING.
426 2013-03-14  Eli Zaretskii  <eliz@gnu.org>
428         * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
429         and incorrect code.  Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
430         and WM_ACTIVATEAPP.
431         (w32fullscreen_hook): If the frame is visible, reset
432         f->want_fullscreen flag after changing the frame size.  If the
433         frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
434         (Bug#13953)
436 2013-03-13  Daniel Colascione  <dancol@dancol.org>
438         * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
439         too so that these builds can use Cygwin's file conversion
440         functions.  (We've been building and linking cygw32.o all along
441         and just not using it.)
443 2013-03-13  Paul Eggert  <eggert@cs.ucla.edu>
445         File synchronization fixes (Bug#13944).
446         * Makefile.in (LIB_FDATASYNC): New macro.
447         (LIBES): Use it.
448         * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
449         * fileio.c (Fwrite_region, write_region_inhibit_fsync):
450         Don't worry about HAVE_FSYNC, since a substitute fsync is
451         available if the system lacks one.
452         (Fwrite_regin): Retry fsync if interrupted.
454 2013-03-13  Eli Zaretskii  <eliz@gnu.org>
456         * w32term.c (w32_read_socket): If the Emacs frame is being
457         activated, call w32fullscreen_hook, to make sure the new frame
458         dimensions are in effect.  (Bug#13937)
460 2013-03-13  Dmitry Antipov  <dmantipov@yandex.ru>
462         * xdisp.c (init_iterator): Simplify because both character and byte
463         positions are either specified or -1.  Add eassert.  Adjust comment.
464         * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
465         character and byte positions can be obtained from marker.
467 2013-03-13  Paul Eggert  <eggert@cs.ucla.edu>
469         Static checking by Sun C 5.12.
470         * alloc.c (buffer_memory_full) [REL_ALLOC]:
471         * bytecode.c (exec_byte_code):
472         * dispnew.c (init_display):
473         * eval.c (error):
474         * fileio.c (Fsubstitute_in_file_name):
475         * keyboard.c (Fevent_convert_list):
476         * keymap.c (Fsingle_key_description):
477         * term.c (maybe_fatal, fatal):
478         * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
479         * xsmfns.c (Fhandle_save_session):
480         Omit unreachable code.
481         * keymap.c (map_keymap_char_table_item): Cast void * to
482         a function pointer type; the C Standard requires this.
484         * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
485         Include <sys/param.h> unconditionally, as that works elsewhere and
486         is simpler here.  Include <sys/sysctl.h> if DARWIN_OS ||
487         __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
488         and FreeBSD now.
490 2013-03-11  Paul Eggert  <eggert@cs.ucla.edu>
492         * insdel.c (adjust_after_replace): Use bool for boolean.
494 2013-03-11  Stefan Monnier  <monnier@iro.umontreal.ca>
496         * keyboard.c: Move keyboard decoding to read_key_sequence.
497         (decode_keyboard_code): Remove.
498         (tty_read_avail_input): Don't try to decode input.
499         (read_decoded_char): New function.
500         (read_key_sequence): Use it.
502 2013-03-10  Daniel Colascione  <dancol@dancol.org>
504         * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
505         (GUI_SDATA, guichar_t): Macros to abstract out differences between
506         NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
507         w32fns.c.
509         * w32term.c (construct_drag_n_drop): Use the above macros to make
510         drag-and-drop work for non-ASCII filenames in cygw32 builds.
512         * w32fns.c (x_set_name, x_set_title): Use the above macros to
513         properly display non-ASCII frame titles in cygw32 builds.
515         * w32fns.c (Fw32_shell_execute): Use the above macros to properly
516         call ShellExecute in cygw32 builds.
518         * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
519         common file dialog code.
521         * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
522         can just use du like other systems.
524         * coding.c (from_unicode_buffer): Declare.
525         * coding.c (from_unicode_buffer): Implement.
527 2013-03-10  Stefan Monnier  <monnier@iro.umontreal.ca>
529         * lread.c: Minor cleanup.
530         (FROM_FILE_P): New macro.
531         (skip_dyn_bytes, unreadchar, read1): Use it.
532         (read_list): Consolidate duplicated code.
534         * bytecode.c (struct byte_stack): Remove `constants' when unused.
536 2013-03-10  Eli Zaretskii  <eliz@gnu.org>
538         * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
539         (redisplay_internal, set_cursor_from_row, try_window)
540         (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
541         (display_line, notice_overwritten_cursor)
542         (mouse_face_from_buffer_pos, note_mouse_highlight):
543         Use MATRIX_ROW_DISPLAYS_TEXT_P.
544         (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
545         (mouse_face_from_string_pos, fast_find_string_pos):
546         Use MATRIX_ROW_VPOS.
548         * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
550         * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
552         * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
553         MATRIX_MODE_LINE_ROW.
555         * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
557 2013-03-10  handa  <handa@gnu.org>
559         * lisp.h (adjust_after_replace): Extern it.
561         * coding.c (detect_coding): Cound the heading ASCII bytes in the
562         case of detection for coding_category_utf_8_auto.
563         (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
564         Skip decoding if all bytes are ASCII.
566         * insdel.c (adjust_after_replace): Make it public.  New arg
567         text_at_gap_tail.
568         (adjust_after_insert): Call adjust_after_replace with the new arg
569         value 0.
571 2013-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
573         * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
574         (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
575         from Elisp via unread-command-events.
577         * keyboard.c (access_keymap_keyremap): Accept nil return value from
578         functions to mean "no change".
580 2013-03-08  Paul Eggert  <eggert@cs.ucla.edu>
582         region-cache.c, scroll.c, search.c: Use bool for booleans.
583         * lisp.h (compile_pattern):
584         * scroll.c (do_scrolling, do_direct_scrolling):
585         * search.c (struct regexp_cache, compile_pattern_1)
586         (compile_pattern, string_match_1, search_command)
587         (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
588         (search_regs_saved, Fregexp_quote):
589         Use bool for boolean.
590         * region-cache.c (region_cache_forward, region_cache_backward):
591         Fix comments to match code: these functions return int, not boolean.
593 2013-03-08  Dmitry Antipov  <dmantipov@yandex.ru>
595         * search.c (find_newline): Accept start and end byte positions
596         as arguments and allow -1 if not known.
597         (find_newline_no_quit): Likewise for start position.
598         * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
599         * bidi.c (bidi_find_paragraph_start): Pass byte position to
600         find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
601         * editfns.c (Fconstrain_to_field): Break long line.
602         Adjust call to find_newline.
603         * indent.c (vmotion): Adjust calls to find_newline_no_quit.
604         Use DEC_BOTH to start next search from the previous buffer
605         position, where appropriate.
606         * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
607         (get_visually_first_element, move_it_vertically_backward): Likewise.
608         Obtain byte position from the display iterator, where appropriate.
610 2013-03-08  Paul Eggert  <eggert@cs.ucla.edu>
612         print.c, process.c: Use bool for booleans.
613         * lisp.h (wait_reading_process_output):
614         * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
615         (strout, debug_output_compilation_hack, float_to_string, print)
616         (print_object):
617         * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
618         (decode_status, status_message, create_process, create_pty)
619         (Fmake_network_process, Fnetwork_interface_info)
620         (wait_reading_process_output, read_process_output)
621         (write_queue_push, write_queue_pop, process_send_signal)
622         (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
623         * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
624         Use bool for booleans.
625         * process.c (Fnetwork_interface_list): Remove unused local.
626         (connect_counter): Now EMACS_INT, not int.
628 2013-03-08  Dmitry Antipov  <dmantipov@yandex.ru>
630         * bidi.c (bidi_fetch_char): Swap first and second arguments
631         to match other functions accepting character and byte positions.
632         Adjust comment.
633         (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
634         (bidi_paragraph_init): Likewise.  Use DEC_BOTH which is faster
635         when you need just to move to the previous buffer position.
636         * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
638 2013-03-07  Eli Zaretskii  <eliz@gnu.org>
640         * .gdbinit (prowlims): Display the enabled_p flag of the row.
642 2013-03-07  Dmitry Antipov  <dmantipov@yandex.ru>
644         Avoid character to byte conversions in motion subroutines.
645         * indent.h (compute_motion, vmotion): Add byte position argument.
646         * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
647         Add eassert.
648         (Fcompute_motion): Break long line.  Adjust call to compute_motion.
649         Use list5 for return value.
650         (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
651         Adjust comments, style and calls to compute_motion.
652         (Fvertical_motion): Adjust call to vmotion.
653         * window.c (Fdelete_other_windows_internal): Record window start
654         byte position and adjust call to vmotion.
655         (window_scroll_line_based): Likewise with call to compute_motion.
656         Use SET_PT_BOTH.
657         (Frecenter): Adjust calls to vmotion.
659 2013-03-07  Dmitry Antipov  <dmantipov@yandex.ru>
661         * lisp.h (list2i, list3i): New functions.
662         (list4i): Move from window.c and make LISP_INLINE.
663         * editfns.c (make_lisp_time):
664         * fns.c (Flocale_info):
665         * keyboard.c (parse_modifiers):
666         * xterm.c (x_ewmh_activate_frame): Use list2i.
667         * instel.c (signal_after_change):
668         * nsfns.m (Fx_server_version, Fxw_color_values):
669         * w32fns.c (Fxw_color_values, Fx_server_version):
670         * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
671         * fileio.c (Fvisited_file_modtime):
672         * nsfns.m (Fns_display_usable_bounds):
673         * w32.c (ltime): Use list4i.
675 2013-03-06  Eli Zaretskii  <eliz@gnu.org>
677         * search.c (find_newline_no_quit): Rename from find_next_newline.
678         Add commentary.
680         * lisp.h (find_newline_no_quit): Rename prototype.
682         * xdisp.c (back_to_previous_line_start)
683         (forward_to_next_line_start, get_visually_first_element)
684         (move_it_vertically_backward): Callers of find_newline_no_quit changed.
685         * indent.c (vmotion): Callers of find_newline_no_quit changed.
686         * bidi.c (bidi_find_paragraph_start): Callers of
687         find_newline_no_quit changed.
689         * msdos.c: Change encoding to cp850.  (Bug#13879)
690         (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
692 2013-03-06  Dmitry Antipov  <dmantipov@yandex.ru>
694         Coding system support cleanup and minor refactoring.
695         * coding.h (enum coding_result_code): Remove
696         CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
697         (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
698         (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
699         (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
700         (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
701         (decode_coding_region, encode_coding_region, decode_coding_string):
702         Remove unused compatibility macros.
703         * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
704         (record_conversion_result): Adjust user.
705         (syms_of_coding): Likewise.
706         (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
707         (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
708         (decode_coding_object): Simplify since xrealloc never returns NULL.
709         Add eassert.
711 2013-03-06  Paul Eggert  <eggert@cs.ucla.edu>
713         Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
714         * sysdep.c (list_system_processes)
715         [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
716         Make it a stub in this case; otherwise the build might fail,
717         and this code hasn't been tested on such hosts anyway.
718         Problem reported by Nelson H. F. Beebe in
719         <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
720         and analyzed by Jérémie Courrèges-Anglas in
721         <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
723 2013-03-06  Dmitry Antipov  <dmantipov@yandex.ru>
725         * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
726         * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
727         (get_visually_first_element, move_it_vertically_backward): Ajust users.
728         * bidi.c (bidi_find_paragraph_start): Likewise.
729         * indent.c (vmotion): Likewise.
731 2013-03-05  Paul Eggert  <eggert@cs.ucla.edu>
733         FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
734         * filelock.c: Include <c-ctype.h>.
735         (MAX_LFINFO): New top-level constant.
736         (lock_info_type): Remove members pid, boot_time.  Add members at,
737         dot, colon.  Change user member to be the entire buffer, not a
738         pointer.  This allows us to handle the case where a foreign
739         pid or boot time exceeds the local range.  All uses changed.
740         (LINKS_MIGHT_NOT_WORK): New constant.
741         (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
742         (defined_WINDOWSNT): Remove.
743         (MAKE_LOCK_NAME, file_in_lock_file_name):
744         Always use .#FILE (not .#-FILE) for the file lock,
745         even if it is a regular file.
746         (rename_lock_file): New function.
747         (create_lock_file): Use it.
748         (create_lock_file, read_lock_data):
749         Prefer a symbolic link for the lock file, falling back on a
750         regular file if symlinks don't work.  Do not try to create
751         symlinks on MS-Windows, due to security hassles.  Stick with
752         POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
753         link, rename, unlink, mkstemp) when creating locks, as a GNUish
754         host may be using a Windowsish file system, and cannot use
755         MS-Windows-only system calls.  Fall back on mktemp if mkstemp
756         doesn't work.  Don't fail merely because of a symlink-contents
757         length limit in the current file system; fall back on regular
758         files.  Increase the symlink contents length limit to 8 KiB, this
759         should be big enough for any real use and doesn't crunch the
760         stack.
761         (create_lock_file, lock_file_1, read_lock_data):
762         Simplify allocation of lock file buffers now that they fit in 8 KiB.
763         (lock_file_1): Return error number, not bool.  All callers changed.
764         (ELOOP): New macro, if not already defined.
765         (read_lock_data): Return size of lock file contents, not Lisp object.
766         All callers changed.  Handle a race condition if some other process
767         replaces a regular-file lock with a symlink lock or vice versa,
768         while we're trying to read the lock.
769         (current_lock_owner): Parse contents more carefully, to help avoid
770         confusing a regular-file lock with some other application's use
771         of the file.  Check for lock file contents being too long, or
772         not parsing correctly.
773         (current_lock_owner, lock_file):
774         Allow foreign pid and boot times that exceed the local range.
775         (current_lock_owner, lock_if_free, lock_file):
776         Simplify allocation of lock file contents.
777         * w32.c (sys_rename_replace): New function, containing most of
778         the contents of the old sys_rename.
779         (sys_rename): Use it.
780         (fchmod): New dummy function.
781         * w32.h (sys_rename_replace, fchmod): New decls.
783 2013-03-05  Eli Zaretskii  <eliz@gnu.org>
785         * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
786         bidi_count_bytes, as the callers now arrange for bidi_it->charpos
787         to be in sync with bidi_it->bytepos.  Suggested by Dmitry Antipov
788         <dmantipov@yandex.ru>.
790 2013-03-05  Dmitry Antipov  <dmantipov@yandex.ru>
792         * composite.c (get_composition_id, fill_gstring_header):
793         Use make_uninit_vector where appropriate.
794         * font.c (Ffont_get_glyphs, build_style_table): Likewise.
795         * xselect.c (clean_local_selection_data): Likewise.
797 2013-03-04  Paul Eggert  <eggert@cs.ucla.edu>
799         Fix misuse of ImageMagick that caused core dump (Bug#13846).
800         * image.c (imagemagick_load_image): Calculate height and width
801         after flattening the image, not before.
803 2013-03-04  Dmitry Antipov  <dmantipov@yandex.ru>
805         * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
806         * ftfont.c (ftfont_shape_by_flt): Likewise.
807         * w32uniscribe.c (uniscribe_shape): Likewise.
809 2013-03-02  Paul Eggert  <eggert@cs.ucla.edu>
811         The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
812         The old approach, which fell back on DIR/.#FILE.0 through
813         DIR/.#FILE.9, had race conditions that could not be easily fixed.
814         If DIR/.#FILE is a non-symlink file, Emacs now does not create a
815         lock file for DIR/FILE; that is, DIR/FILE is no longer partly
816         protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
817         because the locking mechanism was never reliable in that case).
818         This patch fixes this and other bugs discovered by a code
819         inspection that was prompted by
820         <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
821         Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
822         to avoid interoperability problems between the MS-Windows and
823         non-MS-Windows implementations.  MS-Windows and non-MS-Windows
824         instances of Emacs now ignore each others' locks.
825         * filelock.c (defined_WINDOWSNT): New constant.
826         (MAKE_LOCK_NAME, fill_in_lock_file_name):
827         Don't create DIR/.#FILE.0 through DIR/.#FILE.9.  Instead, create
828         DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
829         regular files on MS-Windows hosts.
830         (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
831         Use SAFE_ALLOCA to avoid problems with long file names.
832         (MAX_LFINFO): Now a local constant, not a global macro.
833         (IS_LOCK_FILE): Remove.
834         (lock_file_1): Don't inspect errno if symlink call succeeds;
835         that's not portable.
836         (lock_file): Document that this function can return if lock
837         creation fails.
838         (lock_file): Don't access freed storage.
840 2013-03-02  Andreas Schwab  <schwab@linux-m68k.org>
842         * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren.  (Bug#13734)
844 2013-03-02  Paul Eggert  <eggert@cs.ucla.edu>
846         * textprop.c: Use bool for booleans.
847         (validate_interval_range, Fadd_text_properties)
848         (Fremove_text_properties): Prefer bool to int when either works.
850 2013-03-02  Eli Zaretskii  <eliz@gnu.org>
852         * textprop.c (Fadd_text_properties, Fremove_text_properties):
853         If the interval tree changes as a side effect of calling
854         modify_region, re-do processing starting from the call to
855         validate_interval_range.  (Bug#13743)
857 2013-02-28  Eli Zaretskii  <eliz@gnu.org>
859         * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
860         (Bug#13546).
862 2013-02-27  Eli Zaretskii  <eliz@gnu.org>
864         * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
865         _SH_DENYRW flag, instead of emacs_open, to deny any other process
866         access to the lock file until it is written and closed.
867         (Bug#13807)
869 2013-02-27  Paul Eggert  <eggert@cs.ucla.edu>
871         * callint.c (Qcall_interactively):
872         * macros.c (Qexecute_kbd_macro):
873         Now static.
875 2013-02-26  Bastien Guerry  <bzg@gnu.org>
877         * window.c (Frecenter): Tiny docstring enhancement.
879 2013-02-26  Paul Eggert  <eggert@cs.ucla.edu>
881         Minor textprop integer cleanup.
882         * intervals.h, textprop.c (add_text_properties_from_list):
883         Return void, not int, since nobody uses the return value.
884         * textprop.c (validate_plist, add_properties, remove_properties)
885         (Fadd_text_properties):
886         Don't assume list length fits in int.
887         (interval_has_all_properties, interval_has_some_properties)
888         (interval_has_some_properties_list, add_properties, remove_properties)
889         (Fadd_text_properties, Fremove_text_properties)
890         (Fremove_list_of_text_properties, text_property_stickiness):
891         Use bool for booleans.
892         (Fadd_text_properties, Fremove_text_properties):
893         (Fremove_list_of_text_properties):
894         Reindent do-while as per GNU style.
896 2013-02-25  Eli Zaretskii  <eliz@gnu.org>
898         Implement CLASH_DETECTION for MS-Windows.
900         * filelock.c [WINDOWSNT]: Include w32.h.
901         (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
902         function of that name.  Up-case the macro arguments.
903         (IS_LOCK_FILE): New macro.
904         (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
905         (create_lock_file): New function, with body extracted from
906         lock_file_1.
907         [WINDOWSNT]: Implement lock files by writing a regular file with
908         the lock information as its contents.
909         (read_lock_data): New function, on Posix platforms just calls
910         emacs_readlinkat.
911         [WINDOWSNT]: Read the lock info from the file.
912         (current_lock_owner): Call read_lock_data instead of calling
913         emacs_readlinkat directly.
914         (lock_file) [WINDOWSNT]: Run the file name through
915         dostounix_filename.
917         * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
918         just check if the process by that PID exists.
920         * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
921         also present, as doing so will fail to error out if the file
922         already exists.
924         * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
926         * textprop.c (Fadd_text_properties, Fremove_text_properties)
927         (Fremove_list_of_text_properties): Skip all of the intervals in
928         the region between START and END that already have resp. don't
929         have the requested properties, not just the first one.
930         Add assertions that the loop afterwards always modifies the
931         properties.  (Bug#13743)
933 2013-02-25  Stefan Monnier  <monnier@iro.umontreal.ca>
935         * callint.c (Fcall_interactively): Use the right lexical environment
936         for `interactive' specs (bug#13811).
937         * eval.c (Feval): Accept a lexical environment.
939 2013-02-25  Paul Eggert  <eggert@cs.ucla.edu>
941         Simplify data_start configuration (Bug#13783).
942         This is a followon simplification to the fix for Bug#13650.
943         * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
944         (START_FILES): Remove.  All uses removed.
945         (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
946         (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
947         (buildobj.h): Use it.
948         ($(ALLOBJS)): Depend on globals.h.
949         (temacs$(EXEEXT)): Use $(ALLOBJS).
950         * autodeps.mk (ALLOBJS): Move to Makefile.in.
951         * deps.mk (vm-limit.o):
952         * makefile.w32-in ($(BLD)/vm-limit.$(O)):
953         Do not depend on mem-limits.h.
954         * emacs.c (__do_global_ctors, __do_global_ctors_aux)
955         (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
956         [__GNUC__ && !ORDINARY_LINK]: Remove.
957         * mem-limits.h, pre-crt0.c: Remove.
958         * unexaix.c, unexcoff.c: Don't include mem-limits.h.
959         * unexcoff.c (etext): New decl.
960         (make_hdr): Use DATA_START instead of start_of_data.
961         * vm-limit.c: Move most of mem-limits.h's contents here.
962         (data_start): New decl.  It's OK if this is approximate,
963         so simplify-away some unnecessary exactness.
964         (POINTER): Remove; all uses removed.
965         (data_space_start): Now char *, to avoid casts.
966         (exceeds_lisp_ptr): New function, replacing the old
967         EXCEEDS_LISP_PTR macro.  All uses changed.
968         (check_memory_limits): Simplify and remove casts.
969         (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
970         (memory_warnings): Use data_start instead of start_of_data.
972 2013-02-24  Andreas Schwab  <schwab@linux-m68k.org>
974         * xdisp.c (set_message): Only check for debug-on-message if STRING
975         is a string.  (Bug#13797)
977 2013-02-24  Paul Eggert  <eggert@cs.ucla.edu>
979         Fix regression introduced by July 10 filelock.c patch.
980         * filelock.c (fill_in_lock_file_name): Fix crash caused by the
981         2012-07-10 patch to this file.  Reported by Eli Zaretskii in
982         <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
983         and diagnosed by Andreas Schwab in
984         <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
986 2013-02-22  Paul Eggert  <eggert@cs.ucla.edu>
988         Assume C89 or better.
989         * ralloc.c (SIZE, POINTER, NIL):
990         * vm-limit.c (POINTER):
991         Remove, replacing all uses with C89 equivalents.  These old
992         symbols were present only for porting to pre-C89 platforms.
994 2013-02-22  Claudio Bley  <claudio.bley@gmail.com>
996         * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
997         This avoids warning messages reported as part of Bug#13546.
999 2013-02-21  Ken Brown  <kbrown@cornell.edu>
1001         * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1003 2013-02-20  Stefan Monnier  <monnier@iro.umontreal.ca>
1005         * sheap.c (report_sheap_usage): Prefer message1_nolog.
1007         * keyboard.c (Qcommand_execute): New var.
1008         (command_loop_1, read_char): Use it.
1009         (Fcommand_execute): Remove, replace by an Elisp implementation.
1010         (syms_of_keyboard): Adjust accordingly.
1012 2013-02-19  Daniel Colascione <dancol@dancol.org>
1014         * sheap.c (report_sheap_usage): Use message, not message1, so
1015         that we don't try to create a buffer while we're in the middle
1016         of dumping Emacs.  Explain why.
1018 2013-02-20  Dmitry Antipov  <dmantipov@yandex.ru>
1020         * search.c (find_newline): Return byte position in bytepos.
1021         Adjust comment.
1022         (find_next_newline_no_quit, find_before_next_newline):
1023         Add bytepos argument.
1024         * lisp.h (find_newline, find_next_newline_no_quit)
1025         (find_before_next_newline): Adjust prototypes.
1026         * bidi.c (bidi_find_paragraph_start):
1027         * editfns.c (Fconstrain_to_field, Fline_end_position):
1028         * indent.c (compute_motion, vmotion):
1029         * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1030         (get_visually_first_element, move_it_vertically_backward):
1031         Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1033 2013-02-19  Eli Zaretskii  <eliz@gnu.org>
1035         * w32proc.c (new_child): Avoid leaking handles if the subprocess
1036         resources were not orderly released.
1038 2013-02-17  Eli Zaretskii  <eliz@gnu.org>
1040         * xdisp.c (x_draw_vertical_border): For a window that is neither
1041         the leftmost nor the rightmost, redraw both the left and the right
1042         vertical borders.  (Bug#13723)
1044 2013-02-17  Stefan Monnier  <monnier@iro.umontreal.ca>
1046         * xml.c (init_libxml2_functions):
1047         * sound.c (sound_warning):
1048         * sheap.c (report_sheap_usage):
1049         * process.c (wait_reading_process_output):
1050         * msdos.c (XMenuActivate):
1051         * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1052         * keyboard.c (top_level_1):
1053         * editfns.c (Fmessage, Fmessage_box):
1054         * callint.c (Fcall_interactively):
1055         * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1057 2013-02-17  Jan Djärv  <jan.h.d@swipnet.se>
1059         * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
1060         * frame.c (syms_of_frame): ... to here.
1062 2013-02-16  Eli Zaretskii  <eliz@gnu.org>
1064         * w32.c (sys_chown): Remove unused function.
1066         * w32term.c <input_signal_count>: Declare 'volatile'
1067         unconditionally.  (Bug#9066)
1069         * w32.c (set_errno): Reset h_errno and don't set it to any other
1070         value.  Set errno instead.
1071         (check_errno): Reset h_errno.
1072         (sys_socket, socket_to_fd, sys_bind, sys_connect)
1073         (sys_gethostname, sys_getservbyname, sys_getpeername)
1074         (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1075         (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1076         h_errno.
1077         (sys_gethostbyname): Set h_errno only errors detected.
1079 2013-02-15  Paul Eggert  <eggert@cs.ucla.edu>
1081         * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1083 2013-02-15  Eli Zaretskii  <eliz@gnu.org>
1085         * keyboard.c (read_char): Fix calculation of auto-save time out
1086         when auto-save-timeout is less than 4.  (Bug#13720)
1088         * w32proc.c (new_child): Free up to 2 slots of dead processes at a
1089         time.  Improve diagnostics in DebPrint.  (Bug#13546)
1091         * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1092         (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1093         (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1094         (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1095         make sure errno is set to an appropriate value.  (Bug#13546)
1096         (socket_to_fd): Add assertion against indexing fd_info[] with a
1097         value that is out of bounds.
1098         (sys_accept): If fd is negative, do not set up the child_process
1099         structure for reading.
1101 2013-02-15  Dmitry Antipov  <dmantipov@yandex.ru>
1103         * composite.c (fill_gstring_header): Remove useless prototype.
1104         Break long line.
1105         * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1106         * print.c (PRINTDECLARE, print_object):
1107         * search.c (compile_pattern, fast_looking_at, search_buffer):
1108         (simple_search, boyer_moore, Freplace_match):
1109         * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1110         (get_overlay_arrow_glyph_row, display_mode_element):
1111         (decode_mode_spec_coding, message3):
1112         * xfaces.c (face_at_string_position): Use bool for booleans.
1113         Adjust comments.
1115 2013-02-15  Paul Eggert  <eggert@cs.ucla.edu>
1117         Fix AIX port (Bug#13650).
1118         * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1119         Fix bug introduced in 2012-07-27 change.  DATA_SEG_BITS, if set,
1120         was #undeffed earlier, so it cannot be used as a macro here.
1121         Use the constant and not the macro.
1123 2013-02-15  Eli Zaretskii  <eliz@gnu.org>
1125         * w32proc.c (new_child): If no vacant slots are found in
1126         child_procs[], make another pass looking for slots whose process
1127         has exited or died.  (Bug#13546)
1129         * w32.c (sys_pipe): When failing due to file descriptors above
1130         MAXDESC, set errno to EMFILE.
1131         (_sys_read_ahead): Update cp->status when failing to read serial
1132         communications input, so that the status doesn't stay at
1133         STATUS_READ_IN_PROGRESS.  (Bug#13546)
1135 2013-02-14  Jan Djärv  <jan.h.d@swipnet.se>
1137         * gtkutil.c (tb_size_cb): New function.
1138         (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1140 2013-02-14  Stefan Monnier  <monnier@iro.umontreal.ca>
1142         * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1143         an event.
1145 2013-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
1147         * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1149 2013-02-13  Dmitry Antipov  <dmantipov@yandex.ru>
1151         * font.c (font_range): Add pos_byte argument.  Adjust comment
1152         and break long line.
1153         * font.h (font_range): Adjust prototype.
1154         * composite.c (autocmp_chars): Pass byte position to font_range.
1155         Break long line.  Remove useless prototype and format comment.
1157 2013-02-13  Glenn Morris  <rgm@gnu.org>
1159         * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1161 2013-02-13  Paul Eggert  <eggert@cs.ucla.edu>
1163         Improve AIX port some more (Bug#13650).
1164         With this, it should be as good as it was in 23.3, though it's
1165         still pretty bad: the dumped emacs does not run.  See Mark Fleishman in
1166         http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1167         * unexaix.c (start_of_text): Remove.
1168         (_data, _text): Declare as char[], not int, as AIX manual suggests.
1169         (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1170         (orig_load_scnptr, orig_data_scnptr):
1171         Now off_t, not long, since they are file offsets.
1172         (make_hdr): Use _data, not start_of_data ().
1173         This is the key part of the fix.
1174         (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1175         (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1177         * pre-crt0.c (data_start): Initialize to 1.
1178         This ports to compilers that optimize the external declaration
1179         'int x = 0;' as if it were 'int x;' to shrink the executable.
1181         Improve AIX port (Bug#13650).
1182         This doesn't fix the bug, but it makes progress: Emacs builds now.
1183         * unexaix.c: Include inttypes.h, stdarg.h.
1184         (report_error, report_error_1): Mark as _Noreturn.
1185         (report_error): Don't report the wrong errno.
1186         (report_error_1): Now varargs.  All callers changed.
1187         (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1188         to unsigned.  Don't use ADDR_CORRECT, as it no longer exists.
1189         (write_ptr): Use %p to print address rather than %lx and a cast
1190         to unsigned long.  Grow buffer a bit, to be safer.
1192 2013-02-13  Eli Zaretskii  <eliz@gnu.org>
1194         * bidi.c (bidi_resolve_neutral): After finding the next
1195         non-neutral character, accept NEUTRAL_ON type as well, because
1196         directional control characters, such as LRE and RLE, have their
1197         type converted to that by bidi_resolve_weak.  This avoids aborts
1198         when LRE/RLE follows a run of neutrals.
1199         (bidi_move_to_visually_next): Assert that return value of
1200         bidi_peek_at_next_level is non-negative.  Negative values will
1201         cause an infloop.
1203 2013-02-13  Paul Eggert  <eggert@cs.ucla.edu>
1205         Minor getenv-related fixes.
1206         * callproc.c (Fcall_process_region) [!DOS_NT]:
1207         Avoid unnecessary duplicate call to getenv.
1208         * callproc.c (init_callproc):
1209         * dispnew.c (init_display):
1210         * sysdep.c (sys_subshell):
1211         Omit unnecessary cast of getenv or egetenv.
1213 2013-02-13  Juanma Barranquero  <lekktu@gmail.com>
1215         * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1216         Update dependencies.
1218 2013-02-12  Eli Zaretskii  <eliz@gnu.org>
1220         * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1221         marker's position.
1222         (display_line): Set w->region_showing to the value of
1223         it->region_beg_charpos, not to -1.  This fixes redisplay
1224         optimization when cursor is moved up after M->.  (Bug#13623)
1225         (Bug#13626)
1226         (try_scrolling): Scroll text up more if point is too close to ZV
1227         and inside the scroll margin.  This makes sure point is moved
1228         outside the scroll margin in these cases.
1230         * window.h (struct window): region_showing can no longer be
1231         negative.
1233 2013-02-11  Paul Eggert  <eggert@cs.ucla.edu>
1235         Tune by using memchr and memrchr.
1236         * doc.c (Fsnarf_documentation):
1237         * fileio.c (Fsubstitute_in_file_name):
1238         * search.c (find_newline, scan_newline):
1239         * xdisp.c (pos_visible_p, display_count_lines):
1240         Use memchr and memrchr rather than scanning byte-by-byte.
1241         * search.c (find_newline): Rename from scan_buffer.
1242         Omit first arg TARGET, as it's always '\n'.  All callers changed.
1244         Clean up read_key_sequence a tiny bit more.
1245         * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1246         (read_key_sequence): Remove unused locals.
1248 2013-02-11  Stefan Monnier  <monnier@iro.umontreal.ca>
1250         Clean up read_key_sequence a bit; reread active keymaps after first event.
1251         * keyboard.c (read_char, read_char_x_menu_prompt)
1252         (read_char_minibuf_menu_prompt):
1253         Replace nmaps+maps with a single `map' arg.
1254         (follow_key): Operate on a single map.
1255         (active_maps): New function.
1256         (test_undefined): Also return true for nil bindings.
1257         (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1258         a single (composed) keymap.  Remember `first_event' to choose the right
1259         set of active keymaps.  Recompute the set of keymaps after receiving
1260         the first event.  Remove GOBBLE_FIRST_EVENT.
1261         (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1262         * keyboard.h (read_char): Update declaration.
1263         * lread.c (read_filtered_event): Adjust call to read_char.
1265 2013-02-11  Eli Zaretskii  <eliz@gnu.org>
1267         * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1268         Don't use the limitation on backwards movement when lines are truncated
1269         in the window.  (Bug#13675)
1271 2013-02-11  Dmitry Antipov  <dmantipov@yandex.ru>
1273         * marker.c (set_marker_internal): If desired position is passed
1274         as a marker, avoid call to buf_charpos_to_bytepos.
1275         * window.c (Fset_window_point): Omit redundant type checking.
1276         (Fset_window_start): Likewise.  Format comment.
1277         (window_scroll_pixel_based): Use set_marker_restricted_both
1278         with character and byte positions obtained from an iterator.
1279         (Fset_window_configuration): Use set_marker_restricted_both.
1280         * xdisp.c (message_dolog): Likewise.
1282 2013-02-10  Eli Zaretskii  <eliz@gnu.org>
1284         * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1285         When text lines are longer than window's screen lines, don't move back
1286         too far.  This speeds up some redisplay operations.  (Bug#13675)
1288 2013-02-10  Dmitry Antipov  <dmantipov@yandex.ru>
1290         * syntax.c (scan_sexps_forward): Fix byte position calculation
1291         Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1293 2013-02-10  Paul Eggert  <eggert@cs.ucla.edu>
1295         * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1296         that was not needed.
1298 2013-02-09  Paul Eggert  <eggert@cs.ucla.edu>
1300         Minor hashing refactoring.
1301         * fns.c (SXHASH_REDUCE): Move to lisp.h.
1302         (sxhash_float): Return EMACS_UINT, for consistency with the other
1303         hash functions.
1304         * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1305         non-static inline function and therefore can't use static vars.
1306         (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1307         * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1308         with the other hash functions.
1310 2013-02-09  Eli Zaretskii  <eliz@gnu.org>
1312         * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1313         XXXXXX part of the temporary file pattern is not downcased even
1314         when w32-downcase-file-names is non-nil.  (Bug#13661)
1316         * xdisp.c (decode_mode_spec): Remove handling of %t.
1318         * msdos.c (careadlinkatcwd): Remove.
1320 2013-02-08  Stefan Monnier  <monnier@iro.umontreal.ca>
1322         * lread.c (skip_dyn_bytes): New function (bug#12598).
1323         (read1): Use it.  Use getc instead of READCHAR to read bytes.
1324         (load_each_byte): Remove.  Update users.
1326 2013-02-08  Dmitry Antipov  <dmantipov@yandex.ru>
1328         * search.c (scan_buffer): Calculate end byte position just once.
1329         (scan_newline): Do not recalculate start_byte.
1330         (search_command): Use eassert.
1331         * syntax.c (struct lisp_parse_state): New member location_byte.
1332         (scan_sexps_forward): Record from_byte and avoid redundant
1333         character to byte position calculation ...
1334         (Fparse_partial_sexp): ... here.  Break too long line.
1336 2013-02-08  Dmitry Antipov  <dmantipov@yandex.ru>
1338         * lisp.h (make_uninit_vector): New function.
1339         * alloc.c (Fvector, Fmake_byte_code):
1340         * ccl.c (Fregister_ccl_program):
1341         * charset.c (Fdefine_charset_internal, define_charset_internal):
1342         * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1343         * composite.c (syms_of_composite):
1344         * font.c (Fquery_font, Ffont_info, syms_of_font):
1345         * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1346         * ftfont.c (ftfont_shape_by_flt):
1347         * indent.c (recompute_width_table):
1348         * nsselect.m (clean_local_selection_data):
1349         * syntax.c (init_syntax_once):
1350         * w32unsubscribe.c (uniscribe_shape):
1351         * window.c (Fcurrent_window_configuration):
1352         * xfaces.c (Fx_family_fonts):
1353         * xselect.c (selection_data_to_lisp_data): Use it.
1355 2013-02-07  Dmitry Antipov  <dmantipov@yandex.ru>
1357         * coding.c (Fdefine_coding_system_internal): Use AREF where
1358         argument is known to be a vector.
1359         * fns.c (Flocale_info): Likewise for ASET.
1360         * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1361         * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1363 2013-02-05  Jan Djärv  <jan.h.d@swipnet.se>
1365         * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1366         height.
1368         * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1369         (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1370         updateCollectionBehaviour.
1372         * nsterm.m (NEW_STYLE_FS): Remove.
1373         (ns_last_use_native_fullscreen): New variable.
1374         (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1375         (x_set_window_size): Do not take title bar and tool bar into account
1376         if isFullscreen returns YES.
1377         (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1378         (check_native_fs): New function.
1379         (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1380         (ns_term_init): Remove NEW_STYLE_FS.
1381         (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1382         and tool bar if isFullscreen returns NO.
1383         (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1384         (initFrameFromEmacs:): Initialize fs_is_native.  Replace NEW_STYLE_FS
1385         with HAVE_NATIVE_FS.
1386         (window:willUseFullScreenPresentationOptions:): New method.
1387         (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1388         Hide toolbar if not enabled (Bug#13444).
1389         (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1390         Restore tool bar if enabled, hide it otherwise (Bug#13444).
1391         (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1392         (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1393         window.  Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1394         Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1395         FRAME_TOOLBAR_HEIGHT (f).  Call updateFrameSize when going non-fs.
1396         (syms_of_nsterm): Add ns-use-native-fullscreen.
1398 2013-02-04  Paul Eggert  <eggert@cs.ucla.edu>
1400         * fileio.c (Qchoose_write_coding_system): Now static.
1402 2013-02-04  Eli Zaretskii  <eliz@gnu.org>
1404         * xdisp.c (window_buffer_changed): region_showing can be negative,
1405         which still means region is being displayed.
1406         (redisplay_internal): Resurrect code that forced redisplay of the
1407         whole window when showing region and the mark has changed.
1408         Record the new mark position to allow redisplay optimizations.
1409         (display_line): If it->region_beg_charpos is non-zero, set the
1410         window's region_showing member to -1.  (Bug#13623)  (Bug#13626)
1412         * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1413         not bitfield of 1 bit.
1415 2013-02-03  Daniel Colascione  <dancol@dancol.org>
1417         * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1418         daemon mode works on cygw32 when Emacs is installed and not just
1419         during development.
1421 2013-02-02  Paul Eggert  <eggert@cs.ucla.edu>
1423         Avoid file time stamp bug on MS-Windows (Bug#13149).
1424         * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1425         as FAT32 doesn't update time stamps when truncating them.
1426         Also, check that a file time stamp is not a multiple of 100 ns;
1427         this should catch all instances of the problem on MS-Windows,
1428         as its native file system resolution is 100 ns or worse, and
1429         checking for a non-multiple of 100 ns should impose only a small
1430         overhead on systems with ns resolution.
1432 2013-02-02  Eli Zaretskii  <eliz@gnu.org>
1434         Avoid encoding file names on MS-Windows when they need to be run
1435         through dostounix_filename.
1436         * w32.c (normalize_filename): Accept an additional argument
1437         MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1438         downcase it even if w32-downcase-file-names is non-nil.
1439         (dostounix_filename): Accept an additional argument MULTIBYTE and
1440         pass it to normalize_filename.
1441         (emacs_root_dir): Adjust.
1443         * msdos.h (dostounix_filename): Adjust prototype.
1445         * w32.h (dostounix_filename): Adjust prototype.
1447         * msdos.c (dostounix_filename): Accept an additional argument and
1448         ignore it.
1449         (init_environment): Adjust callers of dostounix_filename.
1451         * fileio.c (Ffile_name_directory, file_name_as_directory)
1452         (directory_file_name, Fexpand_file_name)
1453         (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1454         dostounix_filename.
1455         [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1456         non-nil.
1457         (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1458         variables, as egetenv is case-insensitive for DOS_NT.
1460         * dired.c (file_name_completion): Don't call Fdirectory_file_name
1461         with an encoded file name.
1463         * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1464         Adjust calls to dostounix_filename.
1466         * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1468         * unexw32.c (unexec): Adjust call to dostounix_filename.
1470         * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1472         * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1473         dostounix_filename.
1475         * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1476         dostounix_filename.
1478         * callproc.c (Fcall_process): Make sure program name in PATH and
1479         new_argv[0] is encoded, if needed.  Otherwise, un-encoded string
1480         is passed to exec/spawnve, which fails unless the file-name
1481         encoding is UTF-8.
1483         * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1484         even if w32-quote-process-args is nil.
1486 2013-02-01  Paul Eggert  <eggert@cs.ucla.edu>
1488         Fix timestamp bug when write-region appends nothing (Bug#13149).
1489         * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1490         the file's time stamp doesn't change if Emacs happens to write nothing
1491         to the file, and on a buggy file system this could cause Emacs to
1492         incorrectly infer that the file system doesn't have the bug.
1493         Avoid this problem by inhibiting the inference in this case.
1495 2013-02-01  Dmitry Antipov  <dmantipov@yandex.ru>
1497         * window.h (struct window): Convert base_line_number, base_line_pos
1498         and column_number_displayed members from Lisp_Object to ptrdiff_t.
1499         Convert region_showing member from Lisp_Object to bitfield.
1500         Remove sequence_number member.  Adjust comments.
1501         * window.c (sequence_number): Remove.
1502         (make_window): Initialize column_number_displayed.
1503         * print.c (print_object): Follow the printed representation of
1504         frames and print window pointer to distinguish between windows.
1505         (adjust_window_count): Invalidate base_line_pos.  Adjust comment.
1506         * xdisp.c (wset_base_line_number, wset_base_line_pos)
1507         (wset_column_number_displayed, wset_region_showing): Remove.
1508         (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1509         (try_scrolling, try_cursor_movement, redisplay_window)
1510         (try_window_reusing_current_matrix, try_window_id, display_line)
1511         (display_mode_lines, decode_mode_spec): Adjust users.
1512         * .gdbinit (pwinx): Do not print sequence_number.
1514 2013-02-01  Paul Eggert  <eggert@cs.ucla.edu>
1516         Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1517         * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1518         * dired.c: Include <fcntl.h>.
1519         (open_directory): New function, which uses open and fdopendir
1520         rather than opendir.  DOS_NT platforms still use opendir, though.
1521         (directory_files_internal, file_name_completion): Use it.
1522         (file_attributes): New function, with most of the old Ffile_attributes.
1523         (directory_files_internal, Ffile_attributes): Use it.
1524         (file_attributes, file_name_completion_stat): First arg is now fd,
1525         not dir name.  All uses changed.  Use fstatat rather than lstat +
1526         stat.
1527         (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1528         * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1529         (emacs_readlinkat): New function, with much of the old
1530         Ffile_symlink_p, but with an fd argument for speed.
1531         It uses readlinkat rather than careadlinkatcwd, so that it
1532         need not assume the working directory.
1533         (Ffile_symlink_p): Use it.
1534         * filelock.c (current_lock_owner): Use emacs_readlinkat
1535         rather than emacs_readlink.
1536         * lisp.h (emacs_readlinkat): New decl.
1537         (READLINK_BUFSIZE, emacs_readlink): Remove.
1538         * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1539         (emacs_norealloc_allocator, emacs_readlink): Remove.
1540         This stuff is moved to fileio.c.
1541         * w32.c (fstatat, readlinkat): New functions.
1542         (careadlinkat): Don't check that fd == AT_FDCWD.
1543         (careadlinkatcwd): Remove; no longer needed.
1545 2013-01-31  Glenn Morris  <rgm@gnu.org>
1547         * fileio.c (choose_write_coding_system): Make it callable from Lisp.
1548         (Fwrite_region): Update for new choose_write_coding_system args.
1549         Move the last piece of choose_write_coding_system here.  (Bug#13522)
1550         (syms_of_fileio): Add choose-write-coding-system.
1552 2013-01-30  Eli Zaretskii  <eliz@gnu.org>
1554         * w32.c (sys_open): Zero out the flags for the new file descriptor.
1555         (sys_close): Zero out the flags for the file descriptor before
1556         closing it.  (Bug#13546)
1558         * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
1559         (logon_network_drive, stat_worker, symlink, chase_symlinks):
1560         Use CharNextExA and CharPrevExA to iterate over file names encoded in
1561         DBCS.  (Bug#13553)
1563         * w32.c (w32_get_long_filename, init_environment, readlink):
1564         Support file names encoded in DBCS codepages.
1565         (readlink): Use the current file-name-coding-system, not the ANSI
1566         codepage, to decode and handle targets of symlinks.
1568 2013-01-28  Eli Zaretskii  <eliz@gnu.org>
1570         * w32.c (opendir): Now accepts a 'const char *'.
1572 2013-01-28  Dmitry Antipov  <dmantipov@yandex.ru>
1574         Remove obsolete redisplay code.  See the discussion at
1575         http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1576         * dispnew.c (preemption_period, preemption_next_check): Remove.
1577         (Vredisplay_preemption_period): Likewise.
1578         (update_frame, update_single_window, update_window, update_frame_1):
1579         Adjust users.  Always assume that PERIODIC_PREEMPTION_CHECKING is not
1580         used, following the 2012-06-22 change.
1582 2013-01-25  Eli Zaretskii  <eliz@gnu.org>
1584         * w32notify.c (Fw32notify_add_watch): Doc fix.  (Bug#13540)
1586 2013-01-25  Dmitry Antipov  <dmantipov@yandex.ru>
1588         * font.c (num_fonts): Remove the leftover from old
1589         debugging code.  Adjust comment style here and there.
1590         * insdel.c (insert_1): Remove.
1591         * lisp.h (insert_1): Remove prototype.
1592         * xdisp.c (message_dolog): Adjust users to call insert_1_both.
1594 2013-01-25  Eli Zaretskii  <eliz@gnu.org>
1596         * w32.c (max_filename_mbslen): New function.
1597         (normalize_filename, readdir): Use it to detect locales where ANSI
1598         encoding of file names uses a double-byte character set (DBCS).
1599         If a DBCS encoding is used, advance by characters using
1600         CharNextExA, instead of incrementing a 'char *' pointer.
1601         Use _mbslwr instead of _strlwr.  (Bug#13515)
1603         * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1604         request of memory reservation to 1.7GB.  (Bug#13065)
1606 2013-01-25  Andreas Schwab  <schwab@linux-m68k.org>
1608         * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1609         at check_extra_latin label.  (Bug#13505)
1611 2013-01-24  Dmitry Antipov  <dmantipov@yandex.ru>
1613         * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1614         Avoid redundant calls to strlen.
1616 2013-01-24  Dmitry Antipov  <dmantipov@yandex.ru>
1618         Drop async_visible and async_iconified fields of struct frame.
1619         This is possible because async input is gone; for details, see
1620         http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1621         * frame.h (struct frame): Remove async_visible and async_iconified
1622         members, convert garbaged to unsigned bitfield.  Adjust comments.
1623         (FRAME_SAMPLE_VISIBILITY): Remove.  Adjust all users.
1624         (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1625         * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1626         Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1627         FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1628         * w32term.c: Ditto.
1629         (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1630         properly.  Likewise for obscured.
1631         * xterm.c: Ditto.
1632         (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
1633         properly.
1634         * nsterm.m: Ditto.
1635         (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1637 2013-01-24  Dmitry Antipov  <dmantipov@yandex.ru>
1639         * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1640         in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1642 2013-01-23  Stefan Monnier  <monnier@iro.umontreal.ca>
1644         * xdisp.c (message2, message2_nolog): Remove functions.
1645         (message3, message3_nolog): Extract nbytes and multibyteness directly
1646         from the string.  Change all callers.
1647         (message3_nolog): Don't set message_enable_multibyte since set_message
1648         will reset it anyway.
1649         (message1, message1_nolog): Use message3.
1650         (vmessage): Use a stack allocated buffer rather than f->message_buf.
1651         (with_echo_area_buffer): Remove last two arguments.  Update all callers.
1652         (set_message): Drop all but the second arg, which has to be a string.
1653         (set_message_1): Simplify now that we know that a1 is NULL and the
1654         second arg is a string.
1655         * frame.h (struct frame): Remove `message_buf' field.
1656         Use glyphs_initialized_p instead.
1657         (FRAME_MESSAGE_BUF): Remove macro.
1658         * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1659         * lisp.h (message2, message2_nolog): Remove declarations.
1660         (message3, message3_nolog): Update declarations.
1661         * keyboard.c (read_char_minibuf_menu_text)
1662         (read_char_minibuf_menu_width): Remove vars.
1663         (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1664         to correctly handle multibyte strings.
1665         * frame.c (delete_frame): Don't free message_buf any more.
1666         * editfns.c (message_text, message_length): Remove vars.
1667         (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1668         * fileio.c (auto_save_error): Use message3 instead of message2.
1669         * dispnew.c (adjust_frame_message_buffer): Remove function.
1671 2013-01-23  Eli Zaretskii  <eliz@gnu.org>
1673         * w32term.c (w32fullscreen_hook): Account correctly for the screen
1674         real estate used for the tool bar and the menu bar.
1676 2013-01-23  Dmitry Antipov  <dmantipov@yandex.ru>
1678         * insdel.c (prepare_to_modify_buffer): Force redisplay if
1679         hidden buffer is prepared to modification (Bug#13164).
1681 2013-01-22  Dmitry Antipov  <dmantipov@yandex.ru>
1683         * window.h (struct window): Change window_end_valid member from
1684         Lisp_Object to a bitfield.  Adjust comments.
1685         (wset_window_end_valid): Remove.
1686         * window.c (adjust_window_count): Clear window_end_valid.
1687         (Fwindow_end): Adjust user.  Remove ancient #if 0 code.
1688         (Fwindow_line_height, set_window_buffer, Frecenter)
1689         (Fsplit_window_internal, Fdelete_other_windows_internal)
1690         (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1691         * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1692         * xdisp.c (check_window_end, reconsider_clip_changes)
1693         (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1694         (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1695         (find_first_unchanged_at_end_row, try_window_id): Likewise.
1697 2013-01-22  Dmitry Antipov  <dmantipov@yandex.ru>
1699         * xdisp.c (mark_window_display_accurate): Simplify the loop
1700         assuming that the only one of vchild, hchild or buffer window
1701         slots is non-nil.  Call mark_window_display_accurate_1 for
1702         the leaf windows only.
1703         (mark_window_display_accurate_1): Always assume leaf window.
1704         Adjust comment.
1706 2013-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1708         * emacs.c (Qkill_emacs_hook): Now static.
1710         * fileio.c (Finsert_file_contents): Simplify.
1711         Remove unnecessary assignments and tests.
1713 2013-01-21  Eli Zaretskii  <eliz@gnu.org>
1715         * w32.c (acl_set_file): Don't test for errors unless
1716         set_file_security returns FALSE.  Avoids spurious errors when
1717         saving files.
1719 2013-01-21  Dmitry Antipov  <dmantipov@yandex.ru>
1721         * fileio.c (Finsert_file_contents): Revert code introduced at
1722         2013-01-18 in favor of the simpler and generally better fix.
1723         Save stack space by removing 'buffer' and reusing 'read_buf'
1724         where appropriate.
1726 2013-01-19  Paul Eggert  <eggert@cs.ucla.edu>
1728         * lisp.h (eabs): Define unconditionally (Bug#13419).
1729         The old "#if !defined (eabs)" was an unnecessary revenant of back
1730         when this macro was called "abs".  Document 'eabs' better.
1732 2013-01-19  Glenn Morris  <rgm@gnu.org>
1734         * fns.c (Frandom): Doc fix.
1736 2013-01-19  Eli Zaretskii  <eliz@gnu.org>
1738         * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1739         segfault when there are lots of overlays.
1741         * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
1742         when there are lots of overlays.
1743         See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
1744         for the details and a way to reproduce.
1746 2013-01-19  Paul Eggert  <eggert@cs.ucla.edu>
1748         * fileio.c: Use O_APPEND to append.
1749         This corresponds better to the natural interpretation of "append",
1750         and avoids the need to open the output file twice, or to invoke
1751         lseek when APPEND is neither nil nor a number.
1752         This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1753         (Fwrite_region): Simplify.  Use O_APPEND instead of opening the
1754         file possibly twice, and lseeking to its end; this avoids the
1755         need to lseek on non-regular files.  Do not use O_EXCL and O_TRUNC
1756         at the same time: the combination is never needed and apparently
1757         it doesn't work with DOS_NT.
1759         Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1760         * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1762         Allow floating-point file offsets.
1763         Problem reported by Vitalie Spinu in
1764         <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1765         * fileio.c (emacs_lseek): Remove.
1766         (file_offset): New function.
1767         (Finsert_file_contents, Fwrite_region): Use it.
1769 2013-01-19  Chong Yidong  <cyd@gnu.org>
1771         * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1772         aborting on Fsignal (Bug#13289).
1774 2013-01-19  Eli Zaretskii  <eliz@gnu.org>
1776         * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1777         set_file_security as failure due to insufficient privileges.
1778         Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1779         (fstat): Return owner and group like 'stat' and 'lstat' do.
1781 2013-01-19  Paul Eggert  <eggert@cs.ucla.edu>
1783         Work around bug in CIFS and vboxsf file systems (Bug#13149).
1784         The bug was observed on Ubuntu operating inside a virtual machine,
1785         editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1786         The workaround introduces a race condition on non-buggy hosts,
1787         but it's an unlikely race and anyway there's a nearly identical
1788         nearby race that can't be fixed.
1789         * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1790         New static vars.
1791         (Fwrite_region): Test for file system time stamp bug.
1792         (init_fileio): New function.
1793         * lisp.h (init_fileio): Declare it.
1794         * emacs.c (main): Call it.
1796         * fileio.c (Finsert_file_contents): Simplify new diagnostic
1797         and make it more consistent with other stat-failure diagnostics.
1799 2013-01-18  Dmitry Antipov  <dmantipov@yandex.ru>
1801         Fix crash when inserting data from non-regular files.
1802         See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
1803         for the error description produced by valgrind.
1804         * fileio.c (read_non_regular): Rename to read_contents.
1805         Free Lisp_Save_Value object used to pass parameters.
1806         (read_non_regular_quit): Rename to read_contents_quit.
1807         (Finsert_file_contents): Redesign internal file reading loop to adjust
1808         gap and end positions after each read and so help make_gap to work
1809         properly.  Do not signal an I/O error too early and so do not leave
1810         not yet decoded characters in a buffer, which was the reason of
1811         redisplay crash.  Use list2 to build return value.  Adjust comments.
1813 2013-01-17  Paul Eggert  <eggert@cs.ucla.edu>
1815         Close a race when statting and reading files (Bug#13149).
1816         * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1817         This avoids a race if the file is renamed between stat and open.
1818         This race is not the problem originally noted in Bug#13149;
1819         see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1821 2013-01-17  Dmitry Antipov  <dmantipov@yandex.ru>
1823         * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1824         objects, related functions and macros.
1825         (make_save_value): Adjust prototype.
1826         (make_save_pointer): New prototype.
1827         (SAFE_NALLOCA): Fix indentation.  Use make_save_pointer.
1828         (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1829         * alloc.c (format_save_value): Rename to make_save_value.
1830         (make_save_pointer): New function.
1831         (record_xmalloc): Use make_save_pointer.
1832         * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1833         * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1834         Change users of make_save_value to make_save_pointer.
1835         Likewise for format_save_value and make_save_value.
1837 2013-01-17  Dmitry Antipov  <dmantipov@yandex.ru>
1839         * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1840         (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1841         * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1842         debugging stubs.
1844 2013-01-15  Paul Eggert  <eggert@cs.ucla.edu>
1846         * alloc.c (free_save_value): Now static.
1848 2013-01-15  Dmitry Antipov  <dmantipov@yandex.ru>
1850         * keymap.c (map_keymap_internal): Use format_save_value.
1851         (map_keymap_char_table_item): Adjust accordingly.
1852         * fileio.c (non_regular_fd, non_regular_inserted)
1853         (non_regular_nbytes): Remove.
1854         (Finsert_file_contents): Convert trytry to ptrdiff_t.
1855         Use format_save_value to pass parameters to read_non_regular.
1856         (read_non_regular): Use XSAVE_ macros to extract parameters.
1857         Adjust comment.
1858         * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1859         format_save_value.
1860         (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1862 2013-01-15  Dmitry Antipov  <dmantipov@yandex.ru>
1864         * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1865         extraction from any Lisp_Save_Value slot.  Add type checking.
1866         * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1867         * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1868         * xselect.c: All users changed.
1870 2013-01-15  Dmitry Antipov  <dmantipov@yandex.ru>
1872         Some convenient bits to deal with Lisp_Save_Values.
1873         * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1874         (allocate_misc): Remove prototype.
1875         (format_save_value): New prototype.
1876         * alloc.c (allocate_misc): Revert back to static.
1877         (format_save_value): New function to build Lisp_Save_Value
1878         object with the specified internal structure.
1879         (make_save_value): Reimplement using format_save_value.
1880         * editfns.c (save_excursion_save): Use format_save_value.
1881         (save_excursion_restore): Use XSAVE_OBJECT.
1883 2013-01-14  Paul Eggert  <eggert@cs.ucla.edu>
1885         Avoid needless casts with XSAVE_POINTER.
1886         * alloc.c (mark_object) [GC_MARK_STACK]:
1887         * dired.c (directory_files_internal_unwind):
1888         * fileio.c (do_auto_save_unwind):
1889         * gtkutil.c (pop_down_dialog):
1890         * keymap.c (map_keymap_char_table_item):
1891         * lread.c (load_unwind):
1892         * nsmenu.m (pop_down_menu):
1893         * print.c (print_object) [GC_MARK_STACK]:
1894         * xfns.c (clean_up_file_dialog):
1895         * xmenu.c (cleanup_widget_value_tree):
1896         Omit casts between XSAVE_POINTER and a pointer type.
1898 2013-01-14  Dmitry Antipov  <dmantipov@yandex.ru>
1900         Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1901         * eval.c (eval_sub): Protect `form' from being GCed before its
1902         car and cdr becomes protected with the backtrace entry.
1904 2013-01-14  Dmitry Antipov  <dmantipov@yandex.ru>
1906         Make Lisp_Save_Value more versatile storage for up to four objects.
1907         * lisp.h (toplevel): Enumeration to describe types of saved objects.
1908         (struct Lisp_Save_Value): New layout.  Adjust comments.
1909         (XSAVE_POINTER): New macro.
1910         (XSAVE_INTEGER): Likewise.
1911         (allocate_misc): Add prototype.
1912         (free_misc): Likewise.
1913         * alloc.c (allocate_misc): Now global.
1914         (free_misc): Likewise.  Adjust comment.
1915         (make_save_value): Use new Lisp_Save_Value layout.  Adjust comment.
1916         (free_save_value): Likewise.
1917         (mark_object): Likewise.
1918         * editfns.c (save_excursion_save): Pack everything within
1919         Lisp_Save_Value and so avoid xmalloc.
1920         (save_excursion_restore): Adjust to match new layout.  Use free_misc
1921         because we do not allocate extra memory any more.  Add eassert.
1922         * print.c (print_object): New code to print Lisp_Save_Value.  Do not
1923         rely on valid_lisp_object_p if !GC_MARK_STACK.  Adjust comments.
1924         * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1925         * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1926         Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1928 2013-01-13  Jan Djärv  <jan.h.d@swipnet.se>
1930         * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1931         (nsfont_draw): Remove disabling of LCD smoothing.
1932         (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
1933         Bug#11484 with LCD smoothing on.
1935 2013-01-13  Paul Eggert  <eggert@cs.ucla.edu>
1937         Fix SIGDANGER handlers, for AIX (Bug#13408).
1938         * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1939         Move handlers here from emacs.c; they were out of place.
1941 2013-01-11  Jan Djärv  <jan.h.d@swipnet.se>
1943         * xterm.c (syms_of_xterm): Adjust documentation for
1944         scroll-bar-adjust-thumb-portion.
1946 2012-12-31  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
1948         * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1949         determine whether scroll bar thumb size should be adjusted or
1950         not. Use variable for MOTIF.
1952         * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1953         GTK.
1955 2013-01-13  Jan Djärv  <jan.h.d@swipnet.se>
1957         * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1958         event is generated.
1959         (doCommandBySelector:): Set processingCompose to NO.
1961         * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1962         Remove check for fkeys count > zero, block/unblock fixes the real bug.
1963         (nsfont_list_family): Add block/unblock_input calls.
1964         (nsfont_open): Move block_input earlier.  Add unblock_input before early
1965         return.
1966         (nsfont_draw): Add block/unblock_input calls.
1968 2013-01-12  Dmitry Antipov  <dmantipov@yandex.ru>
1970         * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1971         for old_charpos and old_bytepos.
1973 2013-01-12  Paul Eggert  <eggert@cs.ucla.edu>
1975         Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1976         * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1977         Clear tzvalbuf_in_environ if this workaround is in effect.
1978         Problem and fix reported by Kazuhiro Ito.
1980 2013-01-11  Aaron S. Hawley  <Aaron.Hawley@vtinfo.com>
1982         * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1983         Fix ambiguous doc string cross-reference(s).
1985         * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1986          doc string cross-reference(s).
1988         * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1989          string cross-reference(s).
1991 2013-01-11  Dmitry Antipov  <dmantipov@yandex.ru>
1993         Avoid unnecessary byte position calculation for the gap movement.
1994         Since all users of move_gap do CHAR_TO_BYTE for other purposes
1995         anyway, all of them should use move_gap_both instead.
1996         * lisp.h (move_gap): Remove prototype.
1997         * insdel.c (move_gap): Remove.
1998         (move_gap_both): Add eassert.
1999         * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2000         * xml.c (parse_region): Likewise.
2002 2013-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2004         emacsclient -t should not suspend Emacs server (Bug#13387)
2005         * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2006         New functions.
2007         * term.c (init_tty): Use them instead of rolling our own code.
2008         * sysdep.c (tcsetpgrp_without_stopping): Likewise.  Here, this
2009         switches from 'signal' to 'pthread_sigmask', which is safer in
2010         multithreaded applications.
2011         * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2012         which has already arranged for that.
2013         (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2014         This is the main part of the bug fix.
2016 2013-01-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>  (tiny change)
2018         * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2019         x_last_font_name (Bug#13403).
2021 2013-01-10  Dmitry Antipov  <dmantipov@yandex.ru>
2023         Omit buffer_slot_type_mismatch and use generic predicates to enforce
2024         the type of per-buffer values where appropriate.
2025         * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2026         predicate, which is how it's really used now.  Adjust comment.
2027         * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2028         * buffer.c (buffer_slot_type_mismatch): Remove.
2029         (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2030         predicate.  Adjust comment.
2031         (syms_of_buffer): Use Qsymbolp for major-mode.  Use Qintegerp for
2032         fill-column, left-margin, tab-width, buffer-saved-size,
2033         left-margin-width, right-margin-width, left-fringe-width,
2034         right-fringe-width, scroll-bar-width and buffer-display-count.
2035         Use Qstringp for default-directory, buffer-file-name,
2036         buffer-file-truename and buffer-auto-save-file-name.  Use Qfloatp for
2037         scroll-up-aggressively and scroll-down-aggressively.  Use Qnumberp for
2038         line-spacing.
2039         * data.c (store_symval_forwarding): Adjust to call the predicate.
2041 2013-01-09  Juanma Barranquero  <lekktu@gmail.com>
2043         * w32.c (get_name_and_id, acl_set_file):
2044         * w32term.c (w32fullscreen_hook): Remove unused local variables.
2046 2013-01-09  Dmitry Antipov  <dmantipov@yandex.ru>
2048         * lisp.h (make_gap_1): New prototype.
2049         * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2050         gap size values.
2051         * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2052         naming convention.
2053         (syms_of_editfns): Adjust defsubr.  Drop commented-out obsolete code.
2054         * insdel.c (make_gap_larger): Use GAP_BYTES_DFL.  Adjust comment.
2055         (make_gap_smaller): Use GAP_BYTES_MIN.  Adjust comment.
2056         (make_gap_1): New function to adjust the gap of any buffer.
2057         * coding.c (coding_alloc_by_making_gap): Use it.
2058         * buffer.c (compact_buffer): Likewise.  Use BUF_Z_BYTE, BUF_GAP_SIZE,
2059         GAP_BYTES_DFL and GAP_BYTES_MIN.  Adjust comment.
2061 2013-01-08  Juri Linkov  <juri@jurta.org>
2063         * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2064         of (supports :underline (:style wave)).  (Bug#13000)
2066 2013-01-08  Aaron S. Hawley  <aaron.s.hawley@gmail.com>
2068         * undo.c (Fprimitive_undo): Move to simple.el.
2069         (syms_of_undo): Remove declarations for Sprimitive_undo.
2071 2013-01-08  Stefan Monnier  <monnier@iro.umontreal.ca>
2073         * keyboard.c (echo_add_key): Rename from echo_add_char.
2075 2013-01-06  Chong Yidong  <cyd@gnu.org>
2077         * keyboard.c (echo_add_char): New function, factored out from
2078         echo_char.  Don't add a space if the previous echo string was
2079         empty (Bug#13255).
2080         (echo_char): Use it.
2081         (read_key_sequence): When echoing mock input, ensure that the
2082         trailing dash is properly added.
2084 2013-01-05  Eli Zaretskii  <eliz@gnu.org>
2086         * xdisp.c (dump_glyph): Align glyph data better.  Use "pD" instead
2087         of a non-portable "t" to print ptrdiff_t values.  Allow up to 9
2088         digits for buffer positions, before misalignment starts.
2089         Display "0" for integer "object" field.
2090         (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2091         Display the newline glyph more unambiguously.
2093 2013-01-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2095         * nsterm.m (ns_draw_underwave):
2096         * w32term.c (w32_draw_underwave):
2097         * xterm.c (x_draw_underwave): Make underwave look more triangular
2098         and also degrade gracefully for small fonts.  (Bug#13000)
2100         * nsterm.m (ns_draw_text_decoration):
2101         * w32term.c (x_draw_glyph_string):
2102         * xterm.c (x_draw_glyph_string): Don't use previous underline
2103         thickness and position if previous underline type is underwave.
2105 2013-01-04  Stefan Monnier  <monnier@iro.umontreal.ca>
2107         * fileio.c (Ffile_acl): Undocument return format.
2109 2013-01-02  Glenn Morris  <rgm@gnu.org>
2111         * keymap.c (Fkey_description): Doc fix.  (Bug#13323)
2113 2013-01-02  Paul Eggert  <eggert@cs.ucla.edu>
2115         Simplify via eabs.
2116         * dired.c (file_name_completion):
2117         * doc.c (get_doc_string):
2118         * floatfns.c (round2):
2119         * font.c (font_score, font_delete_unmatched):
2120         * fringe.c (compute_fringe_widths):
2121         * lread.c (read_list):
2122         * minibuf.c (Ftry_completion):
2123         * term.c (tty_ins_del_lines):
2124         * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2125         Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2127 2012-12-31  Eli Zaretskii  <eliz@gnu.org>
2129         * w32.c (unsetenv): Set up the string passed to _putenv
2130         correctly.
2131         See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
2132         for the bug this caused.
2134 2012-12-30  Paul Eggert  <eggert@cs.ucla.edu>
2136         * coding.c (Qmac): Now static.
2138 2012-12-30  Jan Djärv  <jan.h.d@swipnet.se>
2140         * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2141         (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2142         handlebox_widget.  Set toolbar_in_hbox to false/true, set
2143         toolbar_is_packed to true.
2144         (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2145         (update_frame_tool_bar): Check toolbar_is_packed for packing.
2146         Show all on TOOLBAR_TOP_WIDGET.
2147         (free_frame_tool_bar): Check toolbar_is_packed.  Use widget returned
2148         by TOOLBAR_TOP_WIDGET.
2149         (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2150         Check toolbar_is_packed.
2151         (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2152         HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2153         (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2154         false.
2155         (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2156         (xg_update_menubar): Update title only if
2157         HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2158         (xg_update_submenu): Skip tearoff only if
2159         HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2160         (xg_initialize): Initialize xg_detached_menus only if
2161         HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2163         * xterm.h (struct x_output): Surround handlebox_widget with
2164         #ifdef HAVE_GTK_HANDLE_BOX_NEW.  toolbar_is_packed is new,
2165         toolbar_in_hbox is bool.
2167 2012-12-30  Andreas Schwab  <schwab@linux-m68k.org>
2169         * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2170         (LIBS_GNUSTEP): Define.
2171         (LIBES): Add $(LIBS_GNUSTEP).
2172         (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2174 2012-12-30  Eli Zaretskii  <eliz@gnu.org>
2176         * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2177         continuation glyph on a TTY with an indication of an empty line.
2178         (Bug#13277)
2180 2012-12-29  Eli Zaretskii  <eliz@gnu.org>
2182         * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2183         file's SELinux context or ACLs successfully set, nil otherwise.
2184         (Bug#13298)
2185         (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
2187         * w32proc.c (reader_thread): Avoid passing NULL handles to
2188         SetEvent and WaitForSingleObject.
2190 2012-12-28  Paul Eggert  <eggert@cs.ucla.edu>
2192         Port EXTERNALLY_VISIBLE to Clang 3.2.
2193         * conf_post.h (__has_attribute): New macro.
2194         (EXTERNALLY_VISIBLE): Use it.  This ports to Clang 3.2.
2196 2012-12-27  Glenn Morris  <rgm@gnu.org>
2198         * cygw32.c (Fcygwin_convert_file_name_to_windows)
2199         (Fcygwin_convert_file_name_from_windows): Doc fixes.
2201 2012-12-27  Eli Zaretskii  <eliz@gnu.org>
2203         * fileio.c (file_name_as_directory, directory_file_name):
2204         Accept an additional argument MULTIBYTE to indicate whether the input C
2205         came from a multibyte or a unibyte Lisp string; all callers
2206         adjusted.  Don't assume the input string is always multibyte.
2207         (Bug#13262)
2208         (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2209         don't ENCODE_FILE them, and return a unibyte string if the input
2210         was unibyte.
2211         (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2212         don't assume the input strings will always be multibyte.  If the
2213         input strings are multibyte, decode strings obtained from C
2214         library functions.
2216 2012-12-26  Dmitry Antipov  <dmantipov@yandex.ru>
2218         * lisp.h (toplevel): Add two notices to the comment about
2219         defining a new Lisp data type.
2220         * print.c (print_object): If Lisp_Save_Value object's pointer
2221         is the address of a memory area containing Lisp_Objects, try
2222         to print them.
2223         * alloc.c (valid_lisp_object_p): Adjust comment.
2225 2012-12-26  Dmitry Antipov  <dmantipov@yandex.ru>
2227         * keyboard.c (record_asynch_buffer_change): Initialize an event
2228         only if it's really needed.
2229         * frame.h (enum output_method): Remove output_mac member since
2230         it's a leftover from the deleted code.
2231         * frame.c (Fframep): Adjust user here ...
2232         * terminal.c (Fterminal_live_p): ... and here.
2233         * coding.c (Qmac): Now here because it's only used to denote
2234         end-of-line encoding type.
2235         (syms_of_coding): DEFSYM it.
2236         * frame.h (Qmac): Remove duplicated declaration.
2238 2012-12-26  Paul Eggert  <eggert@cs.ucla.edu>
2240         * window.c (select_window_1): Now static, since it's used only here.
2242 2012-12-25  Eli Zaretskii  <eliz@gnu.org>
2244         * window.c (window_body_cols): Subtract display margins from the
2245         window body width on TTYs as well.  See
2246         http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2247         for the original report.
2249 2012-12-25  Dmitry Antipov  <dmantipov@yandex.ru>
2251         * xdisp.c (redisplay_window): Remove inner local variable
2252         because the outer shadowed one has the same meaning.
2253         * xterm.h (struct x_output): Remove toolbar_detached member since it's
2254         set but never used.
2255         * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2256         (xg_create_tool_bar): Adjust users.
2258 2012-12-24  Dmitry Antipov  <dmantipov@yandex.ru>
2260         * buffer.h (BUF_COMPACT): New macro to follow the common style.
2261         * buffer.c (Fget_buffer_create): Use it to set compact field of
2262         struct buffer_text to avoid accessing an uninitialized value
2263         when compact_buffer is called for the first time.
2264         (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2265         (Fset_buffer_modified_p): Use buffer_window_count to check
2266         whether the buffer is displayed in some window.
2267         * xdisp.c (message_dolog): Likewise.
2269 2012-12-23  Eli Zaretskii  <eliz@gnu.org>
2271         * w32.c (acl_set_file): If setting the file security descriptor
2272         fails, and the new DACL is identical to the existing one, silently
2273         return success.  This fixes problems for users backing up their
2274         own files without having the necessary privileges for setting
2275         security descriptors.
2277         * w32proc.c (reader_thread): Do not index fd_info[] with negative
2278         values.
2279         (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2280         after WaitForSingleObject returns normally.  This expedites reader
2281         thread shutdown when delete_child triggers it.
2282         (reap_subprocess): More accurate commentary for why we call
2283         delete_child only when cp->fd is negative.
2285         * w32.c (sys_close): Do not call delete_child on a subprocess
2286         whose handle is not yet closed.  Instead, set its file descriptor
2287         to a negative value, so that reap_subprocess will call
2288         delete_child on that subprocess when its SIGCHLD arrives.
2289         This avoids closing handles used for communications between sys_select
2290         and reader_thread, which doesn't give sys_select a chance to
2291         notice that the process exited and invoke the SIGCHLD handler for
2292         it.
2294 2012-12-23  Jan Djärv  <jan.h.d@swipnet.se>
2296         * nsfns.m (Fns_do_applescript): Run event loop until script has
2297         been executed (Bug#12969).
2298         (ns_run_ascript): Chech as_script for nil, set to nil after
2299         executing script.
2301 2012-12-22  Martin Rudalics  <rudalics@gmx.at>
2303         * window.c (Fselect_window): Reword doc-string (Bug#13248).
2305 2012-12-22  Eli Zaretskii  <eliz@gnu.org>
2307         * w32term.c (w32fullscreen_hook): New function.
2308         (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2310 2012-12-21  Eli Zaretskii  <eliz@gnu.org>
2312         * fileio.c (Finsert_file_contents): Doc fix.
2314         * w32proc.c (new_child, delete_child, find_child_pid): For a
2315         subprocess, consider its slot being in use as long as its process
2316         handle (procinfo.hProcess) is not NULL.  This avoids reusing the
2317         slot when a new process is started immediately after killing
2318         another one, without waiting enough time for the first process to
2319         be reaped and resources allocated for it be orderly freed.
2320         (Bug#13086)
2321         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2323 2012-12-21  Chong Yidong  <cyd@gnu.org>
2325         * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2327         * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2329 2012-12-21  Eli Zaretskii  <eliz@gnu.org>
2331         * w32.c (get_name_and_id): Always pass NULL as the first argument
2332         of lookup_account_sid.  Avoids crashes with UNC file names that
2333         refer to DFS domains, not to specific machine names.  (Bug#12621)
2334         Remove now unused argument FNAME; all callers changed.
2335         (get_file_owner_and_group): Remove now unused argument FNAME; all
2336         callers changed.
2338 2012-12-21  Chong Yidong  <cyd@gnu.org>
2340         * editfns.c (Finsert_char): Since read-char-by-name now signals an
2341         error for invalid chars, don't check for a nil return value.
2343 2012-12-20  Dmitry Antipov  <dmantipov@yandex.ru>
2345         Avoid calls to CHAR_TO_BYTE if byte position is known.
2346         * editfns.c (make_buffer_string_both): Use move_gap_both.
2347         (Fbuffer_string): Use make_buffer_string_both.
2348         * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2349         Adjust comment.
2350         (buf_bytepos_to_charpos): Likewise.
2351         (charpos_to_bytepos): Remove.
2352         * fileio.c (Finsert_file_contents): Use move_gap_both.
2353         * search.c (Freplace_match): Likewise.
2354         * process.c (process_send_region): Likewise.  Use convenient
2355         names for byte positions.
2356         * lisp.h (charpos_to_bytepos): Remove prototype.
2357         * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2358         * insdel.c (move_gap): Likewise.
2360 2012-12-20  Paul Eggert  <eggert@cs.ucla.edu>
2362         * xdisp.c (redisplay_internal): Remove now-unused local.
2364 2012-12-20  Stefan Monnier  <monnier@iro.umontreal.ca>
2366         * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2367         (redisplay_internal): Don't bother selecting the frame to get the
2368         proper value of frame-local variables (bug#13225).
2370 2012-12-20  Dmitry Antipov  <dmantipov@yandex.ru>
2372         * textprop.c (set_text_properties_1): Do not allow NULL interval.
2373         Rename 4th argument since it may be buffer or string.  Adjust comment.
2374         * intervals.c (graft_intervals_info_buffer): Find an interval here.
2376 2012-12-19  Dmitry Antipov  <dmantipov@yandex.ru>
2378         * coding.c (Fdetect_coding_region): Do not check start and end with
2379         CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2380         (code_convert_region): Likewise.
2382 2012-12-18  Eli Zaretskii  <eliz@gnu.org>
2384         * w32.c (acl_get_file, acl_set_file): Run the file name through
2385         map_w32_filename, and resolve any symlinks in the file name, like
2386         Posix platforms do.
2387         (acl_set_file): Call revert_to_self, if any privileges were
2388         enabled.
2390 2012-12-17  Juanma Barranquero  <lekktu@gmail.com>
2392         * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2393         ($(BLD)/w32.$(O)): Update dependencies.
2395 2012-12-17  Stefan Monnier  <monnier@iro.umontreal.ca>
2397         * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2398         propagate redisplay's scrolling (if any) to the right window.
2399         (redisplay_internal): Use ensure_selected_frame.
2400         (display_mode_lines): Complete last fix.
2401         * window.c (select_window_1): New func, extracted from select_window.
2402         (select_window): Use it.
2403         * window.h (select_window_1): Declare.
2405 2012-12-17  Eli Zaretskii  <eliz@gnu.org>
2407         Emulate Posix ACL APIs on MS-Windows.
2408         * w32.c: Include sddl.h and sys/acl.h.
2409         (SDDL_REVISION_1): Define if not already defined.
2410         (g_b_init_get_security_descriptor_dacl)
2411         (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2412         (g_b_init_is_valid_security_descriptor)
2413         (g_b_init_set_file_security): New static flags.
2414         (globals_of_w32): Initialize them to zero.
2415         (SetFileSecurity_Name): New string constant.
2416         (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2417         (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2418         (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2419         (IsValidSecurityDescriptor_Proc): New typedefs.
2420         (get_file_security, get_security_descriptor_owner)
2421         (get_security_descriptor_group): Set errno to ENOTSUP.
2422         (set_file_security, get_security_descriptor_dacl)
2423         (is_valid_security_descriptor, convert_sd_to_sddl)
2424         (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2425         (acl_free, acl_get_file, acl_set_file): New functions.
2427         * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2429 2012-12-17  Paul Eggert  <eggert@cs.ucla.edu>
2431         Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2432         With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2433         for some of that bug's symptoms can now cause Emacs to abort.
2434         Remove the workaround.
2435         * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2436         The bug that caused SIGCHLD to get lost has been fixed, and the
2437         workaround for it can now cause Emacs to abort.
2439 2012-12-16  Paul Eggert  <eggert@cs.ucla.edu>
2441         * sysdep.c (emacs_abort): Bump backtrace size to 40.
2442         Companion to the 2012-09-30 patch.  Suggested by Eli Zaretskii in
2443         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2445 2012-12-16  Romain Francoise  <romain@orebokech.com>
2447         * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2448         (Fcopy_file): Change last arg to `preserve_extended_attributes'
2449         and copy ACL entries of file in addition to SELinux context if set.
2450         (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2452         * Makefile.in (LIBACL_LIBS): New macro.
2453         (LIBES): Use it.
2455 2012-12-15  Paul Eggert  <eggert@cs.ucla.edu>
2457         * fileio.c (internal_delete_file): Use bool for boolean.
2459 2012-12-15  Eli Zaretskii  <eliz@gnu.org>
2461         Fix bug #13079 on MS-Windows with temp files not being deleted.
2462         * w32.h (_child_process): New members input_file and
2463         pending_deletion.
2464         (register_child): First argument is now pid_t.
2465         (record_infile, record_pending_deletion): New prototypes.
2467         * w32proc.c (new_child): Initialize input_file and
2468         pending_deletion members of the child.
2469         (delete_child): Delete the child's temporary input file, if any,
2470         that is pending deletion.
2471         (register_child): First argument is now pid_t.
2472         (record_infile, record_pending_deletion): New functions.
2473         (reap_subprocess): Fix a typo in DebPrint string.
2474         (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2476         * fileio.c (internal_delete_file): Return an int again: non-zero
2477         if delete-file succeeds, zero otherwise.
2479         * lisp.h (internal_delete_file): Adjust prototype.
2481         * callproc.c (Fcall_process): Don't overwrite infile with result
2482         of DECODE_FILE.
2483         [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2484         asynchronous subprocess, record the name of the input file name,
2485         if any.
2486         (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2487         delete the file, record it as pending deletion when the subprocess
2488         exits.
2490 2012-12-14  Eli Zaretskii  <eliz@gnu.org>
2492         * editfns.c [HAVE_PWD_H]: Include grp.h.
2494         * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2496 2012-12-14  Paul Eggert  <eggert@cs.ucla.edu>
2498         Fix permissions bugs with setgid directories etc. (Bug#13125)
2499         * dired.c (Ffile_attributes): Return t as the 9th attribute,
2500         to mark it as a placeholder.  The old value was often wrong.
2501         The only user of this attribute has been changed to use
2502         file-ownership-preserved-p instead, with its new group arg.
2503         * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2505 2012-12-14  Stefan Monnier  <monnier@iro.umontreal.ca>
2507         * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2508         Keep selected_window and selected_frame in sync.
2510 2012-12-14  Eli Zaretskii  <eliz@gnu.org>
2512         * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2513         try to get accurate owner and group information from NT file
2514         security APIs.  This is to make most callers of 'stat' and
2515         'lstat', which don't need that information, much faster.
2517         * dired.c (Ffile_attributes) [WINDOWSNT]:
2518         Set w32_stat_get_owner_group to a non-zero value, to request accurate
2519         owner and group information from 'lstat'.
2521 2012-12-13  Paul Eggert  <eggert@cs.ucla.edu>
2523         * fileio.c (Finsert_file_contents): Don't put tail into head area,
2524         as that confuses set-auto-coding, so insist on the head-read
2525         returning the full 1024 bytes.  Let lseek compute the tail offset;
2526         less work for us.  Do not ignore I/O errors when reading the tail.
2528         * xdisp.c: Minor style fixes.
2529         (init_iterator): Hoist assignment out of if-expression.
2530         (markpos_of_region): Callers now test for sign, not for -1.
2532 2012-12-13  Dmitry Antipov  <dmantipov@yandex.ru>
2534         Minor redisplay optimization when the region length is zero.
2535         * xdisp.c (markpos_of_region): New function.
2536         (init_iterator): Do not highlight the region of zero length.
2537         (redisplay_window): Check whether the region is of non-zero length.
2538         (try_cursor_movement): Allow if the region length is zero.
2539         (try_window_reusing_current_matrix, try_window_id): Likewise.
2541 2012-12-13  Eli Zaretskii  <eliz@gnu.org>
2543         * search.c (search_buffer): Check the inverse translations of each
2544         character in pattern when the buffer being searched is unibyte.
2545         (Bug#13084)
2547 2012-12-13  Paul Eggert  <eggert@cs.ucla.edu>
2549         * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2550         files, fixing a regression from 24.2.
2551         (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
2553 2012-12-13  Paul Eggert  <eggert@cs.ucla.edu>
2555         * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2556         fstat shouldn't fail, and if it does fail copy-file should not proceed.
2557         Remove unnecessary S_ISLNK test, as (contra the comments) this
2558         function can't copy symlinks.  Improve quality of error message
2559         when attempting to copy files that are neither regular files nor
2560         directories.
2562 2012-12-12  Dmitry Antipov  <dmantipov@yandex.ru>
2564         * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2565         * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2566         * window.c (Frecenter):
2567         * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2568         * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2570 2012-12-12  Daniel Colascione  <dancol@dancol.org>
2572         * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
2573         the dumped Emacs is not a sparse file, greatly improving Cygwin
2574         "make bootstrap" performance.
2576 2012-12-11  Michael Albinus  <michael.albinus@gmx.de>
2578         * inotify.c (inotify_callback): Generate an Emacs event for every
2579         incoming inotify event.
2581 2012-12-11  Eli Zaretskii  <eliz@gnu.org>
2583         * xdisp.c (handle_face_prop): Fix logic of computing
2584         it->start_of_box_run_p.
2585         (append_space_for_newline): If the glyph row is R2L, reset the
2586         iterator's end_of_box_run_p flag before prepending the space glyph.
2587         (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2588         iterator's start_of_box_run_p flag before prepending the stretch.
2589         (append_glyph, produce_image_glyph, append_composite_glyph)
2590         (append_stretch_glyph, append_glyphless_glyph): Reverse the
2591         left_box_line_p and right_box_line_p flags of the glyph for R2L
2592         glyph rows.  (Bug#13011)
2594 2012-12-11  Dmitry Antipov  <dmantipov@yandex.ru>
2596         * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2597         if changed buffer is not shown in a window.
2598         * insdel.c (prepare_to_modify_buffer): Likewise.
2599         * window.c (replace_buffer_in_windows_safely): Do nothing
2600         if buffer is not shown in a window.
2601         (Fforce_window_update): Likewise if string or buffer argument
2602         is passed.
2604 2012-12-11  Eli Zaretskii  <eliz@gnu.org>
2606         * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2607         encoded_file_name, which is what it is.
2609 2012-12-11  Dmitry Antipov  <dmantipov@yandex.ru>
2611         Consistently use marker_position and marker_byte_position.
2612         * fringe.c (Ffringe_bitmaps_at_pos):
2613         * indent.c (Fvertical_motion):
2614         * insdel.c (prepare_to_modify_buffer):
2615         * keyboard.c (make_lispy_position):
2616         * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2617         (window_scroll_pixel_based, displayed_window_lines)
2618         (Fset_window_configuration):
2619         * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2620         (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2621         Replace direct access to marker fields with calls
2622         to marker_position and/or marker_byte_position.
2624 2012-12-11  Juanma Barranquero  <lekktu@gmail.com>
2626         * makefile.w32-in (SIG2STR_H): New macro.
2627         (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2628         ($(BLD)/w32notify.$(O)): Update dependencies.
2630 2012-12-10  Daniel Colascione  <dancol@dancol.org>
2632         * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2633         Windows file notification functionality unless WINDOWSNT.
2635         * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2636         declarations.
2638         * w32fns.c (cache_system_info): Initialize the global hinst
2639         variable here so various initialization calls DTRT.
2641         * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
2642         (hinst): Remove unneeded extern declaration.
2643         (_start): Remove initialization of above variables; remove
2644         initialization of hinst, as cache_system_info now does that.
2646         * emacs.c (main): Call cache_system_info early in startup; we
2647         previously weren't calling it in Cygwin builds.
2649         * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2650         Teach the autoconf build system how to compile a Windows resource file
2651         and link it to Emacs.
2653 2012-12-10  Dmitry Antipov  <dmantipov@yandex.ru>
2655         Per-buffer window counters.
2656         * buffer.h (struct buffer): New member window_count.
2657         (buffer_window_count): New function.
2658         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2659         Initialize window_count.
2660         (Fkill_buffer): Verify window_count for the buffer being killed.
2661         (modify_overlay): Do not force redisplay if buffer is not shown
2662         in any window.
2663         (init_buffer_once): Initialize window_count for buffer_defaults
2664         and buffer_local_symbols.
2665         * window.h (buffer_shared): Remove declaration.
2666         (wset_buffer): Convert from inline ...
2667         * window.c (wset_buffer): ... to an ordinary function.
2668         (adjust_window_count): New function.
2669         (make_parent_window): Use it.
2670         * xdisp.c (buffer_shared): Remove.
2671         (redisplay_internal, redisplay_window): Adjust users.
2672         (buffer_shared_and_changed): Use per-buffer window counter.
2674 2012-12-10  Eli Zaretskii  <eliz@gnu.org>
2676         Support for filesystem notifications on MS-Windows.
2677         * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2678         and this is a TTY frame, signal the caller that keyboard input is
2679         available.
2681         * w32xfns.c (drain_message_queue): Now returns an int: an
2682         indication whether any WM_EMACS_FILENOTIFY messages were found in
2683         the queue.
2685         * w32inevt.c (handle_file_notifications): New function.
2686         (w32_console_read_socket): Call it to process file notifications.
2688         * w32console.c (initialize_w32_display): Record the main thread ID
2689         in dwMainThreadId.
2691         * deps.mk (inotify.o): New dependency list.
2693         * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2695         * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2696         (WM_EMACS_END): Bump value by 1.
2697         (notification_buffer_in_use, file_notifications)
2698         (notifications_size, notifications_desc): Declare.
2699         (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2700         Add prototypes.
2702         * w32term.c (lispy_file_action, queue_notifications): New functions.
2703         (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2704         <Qrenamed_to>: New symbols.
2705         (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2707         * w32notify.c: New file, implements file event notifications for
2708         MS-Windows.
2710         * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2711         by posting it to the w32_read_socket queue.
2713         * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2715         * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2716         (GLOBAL_SOURCES): Add w32notify.c
2717         ($(BLD)/w32notify.$(O)): New set of dependencies.
2719         * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2721         * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2722         Handle FILE_NOTIFY_EVENT.
2723         (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2724         (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2725         w32notify-handle-event by default.
2727         * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2728         syms_of_w32notify.
2730 2012-12-10  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
2732         Support for filesystem notifications on GNU/Linux via inotify.
2733         * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
2735         * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2737         * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2738         (syms_of_keyboard): DEFSYM it.
2739         (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2740         (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2741         Qfile_inotify events.
2742         (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2743         special-event-map to inotify-handle-event.
2745         * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2747         * Makefile.in (base_obj): Add inotify.o.
2749         * inotify.c: New file.
2751 2012-12-10  Jan Djärv  <jan.h.d@swipnet.se>
2753         * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2755 2012-12-10  Fabrice Popineau  <fabrice.popineau@gmail.com>
2757         * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2758         DWORD_PTR, for compatibility with 64-bit builds.
2760         * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
2761         (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2762         (system_process_attributes): Use SIZE_T rather than DWORD, for
2763         compatibility with 64-bit builds.
2765 2012-12-10  Christopher Schmidt  <christopher@ch.ristopher.com>
2767         * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2769 2012-12-10  Eli Zaretskii  <eliz@gnu.org>
2771         * indent.c (Fvertical_motion): If a display string will be
2772         displayed on the left or the right margin, don't consider it as a
2773         factor in cursor positioning.  (Bug#13108)
2775 2012-12-10  Martin Rudalics  <rudalics@gmx.at>
2777         * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2779 2012-12-10  Paul Eggert  <eggert@cs.ucla.edu>
2781         * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2782         for string length.
2784 2012-12-08  Eli Zaretskii  <eliz@gnu.org>
2786         * w32.c (unsetenv): Return 0 if the input string is too long.
2788 2012-12-08  Paul Eggert  <eggert@cs.ucla.edu>
2790         Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2791         * alloc.c (xputenv): New function.
2792         * dbusbind.c (Fdbus_init_bus):
2793         * emacs.c (main):
2794         * xterm.c (x_term_init):
2795         Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2796         * editfns.c (initial_tz): Move static var decl up.
2797         (tzvalbuf_in_environ): New static var.
2798         (init_editfns): Initialize these two static vars.
2799         (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2800         Save old TZ value on stack, if it's small.
2801         (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2802         instead, use xputenv+unsetenv to set and restore TZ.
2803         (environbuf): Remove static var.  All uses removed.
2804         (Fset_time_zone_rule): Do not save TZ and environ;
2805         no longer needed here.
2806         (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2807         Move to inside set_time_zone_rule; they don't need file scope any more.
2808         (set_time_zone_rule): Maintain the TZ=value string separately.
2809         (syms_of_editfns): Don't initialize initial_tz;
2810         init_editfns now does it.
2811         * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2812         * lisp.h (xputenv): New decl.
2814 2012-12-08  Fabrice Popineau  <fabrice.popineau@gmail.com>
2816         * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2818 2012-12-08  Eli Zaretskii  <eliz@gnu.org>
2820         * w32.c (unsetenv, sys_putenv): New functions.
2822 2012-12-08  Chong Yidong  <cyd@gnu.org>
2824         * editfns.c (Finsert_char): Make the error message more
2825         informative (Bug#12992).
2827 2012-12-08  Paul Eggert  <eggert@cs.ucla.edu>
2829         Simplify get_lim_data.
2830         * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2831         Remove USG and vlimit methods; no longer used these days.
2832         Add #error catchall just in case.
2834         Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2835         Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2836         SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2837         * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2838         (deleted_pid_list, Fdelete_process, create_process)
2839         (record_child_status_change, handle_child_signal, deliver_child_signal)
2840         (init_process_emacs, syms_of_process):
2841         Assume SIGCHLD is defined.
2842         (parse_signal): Remove.  All uses removed.
2843         (abbr_to_signal): New static function.
2844         (Fsignal_process): Use it to convert signal names to ints.
2845         * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2846         kill (getpgrp (), ...).
2847         (emacs_sigaction_init): Assume SIGCHLD is defined.
2848         (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2849         SIGPIPE, and SIGQUIT are defined.  Do not worry about SIGCLD any more.
2850         * syssignal.h (EMACS_KILLPG): Remove.
2851         All uses replaced by 'kill' with a negative pid.
2852         (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2853         * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2855 2012-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2857         * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2858         This will cause a production Emacs to dump core instead of
2859         infinite-looping.
2861 2012-12-07  Dmitry Antipov  <dmantipov@yandex.ru>
2863         * frame.c (make_frame): Do not set window's buffer to t.
2864         * window.c (Fsplit_window_internal): Likewise.  Previously it was
2865         used to indicate that the window is being set up.  Now we use
2866         set_window_buffer for all new windows, so the condition in ...
2867         (Fset_window_buffer): ... is always true and can be removed.
2869 2012-12-07  Dmitry Antipov  <dmantipov@yandex.ru>
2871         Convenient macro to check whether the buffer is hidden.
2872         * buffer.h (BUFFER_HIDDEN_P): New macro.
2873         * frame.c (make_frame): Use it.  Adjust comment.
2874         * buffer.c (candidate_buffer): New function.
2875         (Fother_buffer, other_buffer_safely): Use it.
2877 2012-12-06  Eli Zaretskii  <eliz@gnu.org>
2879         * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2880         if the child process is still running.  Instead, exit the wait
2881         loop and return zero.  (Bug#13086)
2883 2012-12-06  Dmitry Antipov  <dmantipov@yandex.ru>
2885         * frame.h (x_char_width, x_char_height): Remove prototypes.
2886         * w32term.h (x_char_width, x_char_height): Likewise.
2887         * xfns.c (x_char_width, x_char_height): Remove.
2888         * w32fns.c (x_char_width, x_char_height): Likewise.
2889         * nsfns.c (x_char_width, x_char_height): Likewise.
2890         * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2891         all window frames.
2892         (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2893         * keyboard.c (command_loop_1): Remove prototype.
2894         (command_loop_2, top_level_1): Add static to match prototype.
2896 2012-12-06  Paul Eggert  <eggert@cs.ucla.edu>
2898         Fix a recently-introduced delete-process race condition.
2899         * callproc.c, process.h (record_kill_process):
2900         New function, containing part of the old call_process_kill.
2901         (call_process_kill): Use it.
2902         This does not change call_process_kill's behavior.
2903         * process.c (Fdelete_process): Use record_kill_process to fix a
2904         race condition that could cause Emacs to lose track of a child.
2906 2012-12-06  Dmitry Antipov  <dmantipov@yandex.ru>
2908         Avoid code duplication between prev_frame and next_frame.
2909         * frame.c (candidate_frame): New function.  Add comment.
2910         (prev_frame, next_frame): Use it.  Adjust comment.
2912 2012-12-06  Eli Zaretskii  <eliz@gnu.org>
2914         * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2915         fails, signal an error instead of continuing with an empty
2916         string.  (Bug#13079)
2917         Encode expanded temp file pattern before passing it to mkstemp or
2918         mktemp.
2920         * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2921         Encode the file name before passing it to dostounix_filename, in
2922         case it will downcase it (under w32-downcase-file-names).
2923         (Bug#12933)
2925 2012-12-05  Paul Eggert  <eggert@cs.ucla.edu>
2927         Minor call-process cleanups.
2928         * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2929         at the same time as other platforms, to simplify analysis.
2930         No need for fd0_volatile since we have synch_process_fd.
2931         Avoid needless emacs_close; arg is always negative.
2933 2012-12-04  Andreas Schwab  <schwab@linux-m68k.org>
2935         * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2936         processes.
2938 2012-12-04  Dmitry Antipov  <dmantipov@yandex.ru>
2940         * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2941         member.  Adjust users.  Convert mouse_face_past_end, mouse_face_defer
2942         and mouse_face_hidden members to a bitfields.
2943         * frame.h (struct frame): Remove set-but-not-used space_width member.
2944         (FRAME_SPACE_WIDTH): Remove.
2945         * nsterm.m, w32term.c, xterm.c: Adjust users.
2946         * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2947         member.  Adjust users.  Convert term_initted, delete_in_insert_mode,
2948         costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2949         members to a bitfields.
2951 2012-12-03  Paul Eggert  <eggert@cs.ucla.edu>
2953         Don't let call-process be a zombie factory (Bug#12980).
2954         Fixing this bug required some cleanup of the signal-handling code.
2955         As a side effect, this change also fixes a longstanding rare race
2956         condition whereby Emacs could mistakenly kill unrelated processes,
2957         and it fixes a bug where a second C-g does not kill a recalcitrant
2958         synchronous process in GNU/Linux and similar platforms.
2959         The patch should also fix the last vestiges of Bug#9488,
2960         a bug which has mostly been fixed on the trunk by other changes.
2961         * callproc.c, process.h (synch_process_alive, synch_process_death)
2962         (synch_process_termsig, sync_process_retcode):
2963         Remove.  All uses removed, to simplify analysis and so that
2964         less consing is done inside critical sections.
2965         * callproc.c (call_process_exited): Remove.  All uses replaced
2966         with !synch_process_pid.
2967         * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2968         These take the role of what used to be in unwind-protect arg.
2969         All uses changed.
2970         (block_child_signal, unblock_child_signal):
2971         New functions, to avoid races that could kill innocent-victim processes.
2972         (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2973         (call_process_kill): Record killed processes as deleted, so that
2974         zombies do not clutter up the system.  Do this inside a critical
2975         section, to avoid a race that would allow the clutter.
2976         (call_process_cleanup): Fix code so that the second C-g works again
2977         on common platforms such as GNU/Linux.
2978         (Fcall_process): Create the child process in a critical section,
2979         to fix a race condition.  If creating an asynchronous process,
2980         record it as deleted so that zombies do not clutter up the system.
2981         Do unwind-protect for WINDOWSNT too, as that's simpler in the
2982         light of these changes.  Omit unnecessary call to emacs_close
2983         before failure, as the unwind-protect code does that.
2984         * callproc.c (call_process_cleanup):
2985         * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2986         * process.c (record_deleted_pid): New function, containing
2987         code refactored out of Fdelete_process.
2988         (Fdelete_process): Use it.
2989         (process_status_retrieved): Remove.  All callers changed to use
2990         child_status_change.
2991         (record_child_status_change): Remove, folding its contents into ...
2992         (handle_child_signal): ... this signal handler.  Now, this
2993         function is purely a handler for SIGCHLD, and is not called after
2994         a synchronous waitpid returns; the synchronous code is moved to
2995         wait_for_termination.  There is no need to worry about reaping
2996         more than one child now.
2997         * sysdep.c (get_child_status, child_status_changed): New functions.
2998         (wait_for_termination): Now takes int * status and bool
2999         interruptible arguments, too.  Do not record child status change;
3000         that's now the caller's responsibility.  All callers changed.
3001         Reimplement in terms of get_child_status.
3002         (wait_for_termination_1, interruptible_wait_for_termination):
3003         Remove.  All callers changed to use wait_for_termination.
3004         * syswait.h: Include <stdbool.h>, for bool.
3005         (record_child_status_change, interruptible_wait_for_termination):
3006         Remove decls.
3007         (record_deleted_pid, child_status_changed): New decls.
3008         (wait_for_termination): Adjust to API changes noted above.
3010         * bytecode.c, lisp.h (Qbytecode): Remove.
3011         No longer needed after 2012-11-20 interactive-p changes.
3013 2012-12-03  Eli Zaretskii  <eliz@gnu.org>
3015         * xdisp.c (redisplay_window): If the cursor is visible, but inside
3016         the scroll margin, move point outside the margin.  (Bug#13055)
3018 2012-12-03  Jan Djärv  <jan.h.d@swipnet.se>
3020         * gtkutil.c (my_log_handler): New function.
3021         (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3023 2012-12-03  Dmitry Antipov  <dmantipov@yandex.ru>
3025         * lisp.h (modify_region): Rename to...
3026         (modify_region_1): ...new prototype.
3027         * textprop.c (modify_region): Now static.  Adjust users.
3028         * insdel.c (modify_region): Rename to...
3029         (modify_region_1): ...new function to work with current buffer.
3030         Adjust comment and users.  Use true and false for booleans.
3032 2012-12-03  Dmitry Antipov  <dmantipov@yandex.ru>
3034         * alloc.c (free_save_value): New function.
3035         (safe_alloca_unwind): Use it.
3036         * lisp.h (free_save_value): New prototype.
3037         * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3038         Add comment.
3039         (save_excursion_restore): Adjust to match saved data structure.
3040         Use free_save_value to offload some work from GC.  Drop obsolete
3041         #if 0 code.
3043 2012-12-03  Chong Yidong  <cyd@gnu.org>
3045         * fileio.c (Vauto_save_list_file_name): Doc fix.
3047 2012-12-03  Fabrice Popineau  <fabrice.popineau@gmail.com>
3049         * w32fns.c: Remove prototype of atof.
3050         (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
3051         builds.
3052         (file_dialog_callback): Make it UINT_PTR.
3054         * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3055         with 64-bit builds.
3057         * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3058         (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3059         defined.
3061 2012-12-03  Glenn Morris  <rgm@gnu.org>
3063         * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
3065 2012-12-02  Paul Eggert  <eggert@cs.ucla.edu>
3067         Fix xpalloc confusion after memory is exhausted.
3068         * alloc.c (xpalloc): Comment fix.
3069         * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3070         and signals an error, do not clear charset_table_size, as
3071         charset_table is still valid.
3072         * doprnt.c (evxprintf): Clear *BUF after freeing it.
3074         Use execve to avoid need to munge environ (Bug#13054).
3075         * callproc.c (Fcall_process):
3076         * process.c (create_process):
3077         Don't save and restore environ; no longer needed.
3078         * callproc.c (child_setup):
3079         Use execve, not execvp, to preserve environ.
3081 2012-12-01  Paul Eggert  <eggert@cs.ucla.edu>
3083         * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3085 2012-12-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
3087         * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3088         display for sliced images (Bug#10500).
3090         * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3092 2012-11-30  Juanma Barranquero  <lekktu@gmail.com>
3094         * doc.c (Fdocumentation): Re-add handling of function-documentation,
3095         accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3097 2012-11-29  Dmitry Antipov  <dmantipov@yandex.ru>
3099         * xdisp.c (window_outdated): Remove eassert since it hits
3100         some suspicious corner cases (see Bug#13007 and Bug#13012).
3101         (mode_line_update_needed): New function.
3102         (redisplay_internal, redisplay_window): Use it.
3103         (ensure_selected_frame): New function.
3104         (redisplay_internal, unwind_redisplay): Use it.
3105         (redisplay_internal): Move comment about buffer_shared...
3106         (buffer_shared_and_changed): ...near to its real use.
3108 2012-11-29  Paul Eggert  <eggert@cs.ucla.edu>
3110         * callproc.c (Fcall_process): Don't misreport vfork failure.
3112 2012-11-28  Paul Eggert  <eggert@cs.ucla.edu>
3114         * callproc.c (Fcall_process): Fix vfork portability problems.
3115         Do not assume that fd[0], count, filefd, and save_environ survive
3116         vfork.  Fix bug whereby wrong errno value could be reported for
3117         pipe failure.  Some minor cleanups, too, as follows.  Move buf and
3118         bufsize to the context where they're needed.  Change new_argv to
3119         be of type char **, as this is more convenient and avoids casts.
3120         (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3121         Now local constants, not macros.
3123 2012-11-18  Kenichi Handa  <handa@gnu.org>
3125         * font.c (font_unparse_xlfd): Fix previous change.  Keep "const"
3126         for the variable "f".
3128 2012-11-13  Kenichi Handa  <handa@gnu.org>
3130         * font.c (font_unparse_xlfd): Exclude special characters from the
3131         generating XLFD name.
3133 2012-11-27  Paul Eggert  <eggert@cs.ucla.edu>
3135         Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3136         * dired.c (stat_uname, stat_gname):
3137         * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3139         Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3140         * dired.c (directory_files_internal, file_name_completion):
3141         Assume EAGAIN and EINTR are defined.
3143         * fileio.c (Fcopy_file): Assume EISDIR is defined.
3144         * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3145         * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3146         * lread.c (readbyte_from_file): Assume EINTR is defined.
3147         * process.c (wait_reading_process_output, send_process) [subprocesses]:
3148         Assume EIO and EAGAIN are defined.
3149         * unexcoff.c (write_segment): Assume EFAULT is defined.
3151 2012-11-27  Eli Zaretskii  <eliz@gnu.org>
3153         * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3154         (Bug#11964)
3156         * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3157         highlighting on the frame was cleared.  Prevents assertion
3158         violations when repeatedly clicking on the "Top" link of the
3159         "bread-crumbs" in Info buffers.
3161 2012-11-25  Paul Eggert  <eggert@cs.ucla.edu>
3163         * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3165 2012-11-24  Ken Brown  <kbrown@cornell.edu>
3167         * keyboard.c (HAVE_MOUSE):
3168         * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3169         were always defined.
3171 2012-11-24  Eli Zaretskii  <eliz@gnu.org>
3173         * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3174         between bpos_covered and bpos_max.  This fixes cursor display when
3175         several display strings follow each other.
3177         * .gdbinit (pgx): If the glyph's object is a string, display the
3178         pointer to string data, rather than the value of the string object
3179         itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3181         * indent.c (Fvertical_motion): If the starting position is covered
3182         by a display string, return to one position before that, to avoid
3183         overshooting it inside move_it_to.  (Bug#12930)
3185 2012-11-23  Dmitry Antipov  <dmantipov@yandex.ru>
3187         * frame.h (struct frame): Remove display_preempted member
3188         since all users are dead long ago.
3189         * nsterm.h (struct x_output): Use the only dummy member.
3190         * w32menu.c (pending_menu_activation): Remove since not
3191         really used.
3192         (set_frame_menubar): Adjust user.
3193         * w32term.h (struct x_output): Drop outdated #if 0 code.
3194         (struct w32_output): Use bitfields for explicit_parent,
3195         asked_for_visible and menubar_active members.
3196         Drop unused pending_menu_activation member.
3197         * xterm.h (struct x_output): Drop outdated #if 0 code.
3198         Use bitfields for explicit_parent, asked_for_visible,
3199         has_been_visible and net_wm_state_hidden_seen members.
3201 2012-11-23  Eli Zaretskii  <eliz@gnu.org>
3203         * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3204         of a literal "/".  (Bug#12955)
3205         (gl-stamp): Invoke fc.exe directly, not through cmd.
3207 2012-11-23  Paul Eggert  <eggert@cs.ucla.edu>
3209         Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3210         * dired.c: Assume HAVE_DIRENT_H.
3211         (NAMLEN): Remove, replacing with ...
3212         (dirent_namelen): New function.  All uses changed.  Use the GNU macro
3213         _D_EXACT_NAMELEN if available, as it's faster than strlen.
3214         (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3215         (DIRENTRY_NONEMPTY): Remove.  All callers now assume it's nonzero.
3216         * makefile.w32-in (DIR_H): Remove.  All uses replaced with
3217         $(NT_INC)/dirent.h.
3218         ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3219         * ndir.h: Rename to ../nt/inc/dirent.h.
3220         * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3221         Do not include <dirent.h>; no longer needed.
3222         * w32.c: Include <dirent.h> rather than "ndir.h".
3224 2012-11-23  Chong Yidong  <cyd@gnu.org>
3226         * xftfont.c (xftfont_open): Remove duplicate assignment.
3228 2012-11-22  Dmitry Antipov  <dmantipov@yandex.ru>
3230         * alloc.c (Fgarbage_collect): Unblock input after clearing
3231         gc_in_progress to avoid note_mouse_highlight glitch with GC.
3232         * frame.h (FRAME_MOUSE_UPDATE): New macro.
3233         * msdos.c (IT_frame_up_to_date): Use it here...
3234         * w32term.c (w32_frame_up_to_date): ...here...
3235         * xterm.c (XTframe_up_to_date): ...and here...
3236         * nsterm.m (ns_frame_up_to_date): ...but not here.
3237         * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3238         Adjust users.
3239         * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3240         Do not check whether GC is in progress.
3242 2012-11-22  Dmitry Antipov  <dmantipov@yandex.ru>
3244         * xdisp.c (window_buffer_changed): New function.
3245         (update_menu_bar, update_tool_bar): Use it to
3246         simplify large 'if' statements.
3247         (redisplay_internal): Generalize commonly used
3248         'tail' and 'frame' local variables.
3250 2012-11-22  Eli Zaretskii  <eliz@gnu.org>
3252         * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3253         with Windows system header.
3255 2012-11-21  Paul Eggert  <eggert@cs.ucla.edu>
3257         Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3258         * alloc.c: Assume unistd.h exists.
3259         * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3260         * sysdep.c (get_current_dir_name): Assume getcwd exists.
3261         (getwd) [USG]: Remove; no longer needed.
3262         (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3263         * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3264         * w32.h (getcwd): Remove decl.
3266 2012-11-21  Stefan Monnier  <monnier@iro.umontreal.ca>
3268         * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3269         Make it set selected_window as well.
3270         (update_tool_bar): Use it.
3272 2012-11-21  Ken Brown  <kbrown@cornell.edu>
3274         * emacs.c (main): Set the G_SLICE environment variable for all
3275         Cygwin builds, not just GTK builds.  See
3276         https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3278 2012-11-21  Eli Zaretskii  <eliz@gnu.org>
3280         * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3281         (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3282         Define for the MSVC compiler.
3284         * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
3286         * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3287         (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3288         dostounix_filename.  Prevents crashes down the road, because
3289         dostounix_filename assumes it gets a unibyte string.
3290         Reported by Michel de Ruiter <michel@sentient.nl>, see
3291         http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3293 2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
3295         Conflate Qnil and Qunbound for `symbol-function'.
3296         * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3297         * lread.c (init_obarray): Set `function' fields to Qnil.
3298         * eval.c (Fcommandp): Ignore Qunbound.
3299         (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3300         * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3301         Test NILP rather than Qunbound.
3302         (Ffmakunbound): Set to Qnil.
3303         (Fsymbol_function): Never signal an error.
3304         (Finteractive_form): Ignore Qunbound.
3306 2012-11-20  Paul Eggert  <eggert@cs.ucla.edu>
3308         * eval.c (interactive_p): Remove no-longer-used decl.
3310 2012-11-20  Dmitry Antipov  <dmantipov@yandex.ru>
3312         * xdisp.c (buffer_shared): Adjust comment.
3313         (buffer_shared_and_changed): New function.
3314         (prepare_menu_bars, redisplay_internal): Use it to
3315         decide whether all windows or frames should be updated.
3316         (window_outdated): New function.
3317         (text_outside_line_unchanged_p, redisplay_window): Use it.
3318         (redisplay_internal): Likewise.  Fix indentation.
3320 2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
3322         * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3323         (syms_of_eval): Remove corresponding defsubr.
3324         * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3326 2012-11-19  Daniel Colascione  <dancol@dancol.org>
3328         * w32fns.c (Fx_file_dialog):
3329         (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3330         cygwin_convert_file_name*.
3332         * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3333         Rename cygwin_convert_path* to cygwin_convert_file_name*.
3335 2012-11-18  Paul Eggert  <eggert@cs.ucla.edu>
3337         * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3339 2012-11-18  Eli Zaretskii  <eliz@gnu.org>
3341         * w32select.c: Include w32common.h before w32term.h, so that
3342         windows.h gets included before w32term.h uses some of its
3343         features, see below.
3345         * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3346         New typedefs.
3347         (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3348         New prototypes.
3349         (EnumSystemLocales) [_MSC_VER]: Define if undefined.  (Bug#12878)
3351 2012-11-18  Jan Djärv  <jan.h.d@swipnet.se>
3353         * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3354         (ns_select): Return at once if events are held (Bug#12834).
3356 2012-11-18  enami tsugutomo  <tsugutomo.enami@jp.sony.com>
3358         * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3359         Needed following 2012-10-20 change.  (Bug#12902)
3361 2012-11-18  Juanma Barranquero  <lekktu@gmail.com>
3363         * w32proc.c (waitpid): Remove unused label get_result.
3365 2012-11-17  Juanma Barranquero  <lekktu@gmail.com>
3367         * makefile.w32-in (SYSWAIT_H): New macro.
3368         ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3369         ($(BLD)/sysdep.$(O)): Update dependencies.
3371 2012-11-17  Paul Eggert  <eggert@cs.ucla.edu>
3373         Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3374         * callproc.c (relocate_fd): Assume F_DUPFD.
3375         * emacs.c, term.c (O_RDWR): Remove.
3376         * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3377         O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3378         * nsterm.m: Assume <fcntl.h> exists.
3379         * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3380         (create_pty, Fmake_network_process, server_accept_connection)
3381         (wait_reading_process_output, init_process_emacs):
3382         Assume O_NONBLOCK.
3383         (wait_reading_process_output): Put in a special case for WINDOWSNT
3384         to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3385         It's not clear this is needed, but it's a more-conservative change.
3386         (create_process): Assume FD_CLOEXEC.
3387         (create_process, create_pty): Assume O_NOCTTY.
3388         * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3389         (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3390         Omit if not DOS_NT, since F_GETFL is not defined there.
3391         (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3392         * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3393         (O_NOCTTY): Remove.
3394         (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3395         lack it, since gnulib guarantees this.
3396         * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3398 2012-11-17  Eli Zaretskii  <eliz@gnu.org>
3400         * w32.c (faccessat): Pretend that directories have the execute bit
3401         set.  Emacs expects that, e.g., in files.el:cd-absolute.
3403         * w32proc.c (create_child): Don't clip the PID of the child
3404         process to fit into an Emacs integer, as this is no longer a
3405         restriction.
3406         (waitpid): Rename from sys_wait.  Emulate a Posix 'waitpid' by
3407         reaping only the process specified by PID argument, if that is
3408         positive.  Use PID instead of dead_child to know which process to
3409         reap.  Wait for the child to die only if WNOHANG is not in
3410         OPTIONS.
3411         (sys_select): Don't set dead_child.
3413         * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3414         as it is no longer needed.
3416         * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3417         no longer needed.
3418         (record_child_status_change): Remove the setting of
3419         record_at_most_one_child for the !WNOHANG case.
3421 2012-11-17  Paul Eggert  <eggert@cs.ucla.edu>
3423         Fix problems in ns port found by static checking.
3424         * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3425         (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3426         not to process group.
3427         (ns_select): Use emacs_write, not write, as that's more robust
3428         in the presence of signals.
3429         (fd_handler:): Check for read errors.
3431 2012-11-16  Glenn Morris  <rgm@gnu.org>
3433         * editfns.c (Fmessage): Mention message-log-max.  (Bug#12849)
3435 2012-11-16  Stefan Monnier  <monnier@iro.umontreal.ca>
3437         * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3439 2012-11-16  Eli Zaretskii  <eliz@gnu.org>
3441         * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3442         use the same value of thread handle.
3443         (start_timer_thread): If the timer thread exited (due to error),
3444         clean up by closing the two handles it used.  Duplicate the caller
3445         thread's handle here, so it gets duplicated only once, when
3446         launching the timer thread.  Set priority of the timer thread, not
3447         the caller thread.
3448         (getitimer): Don't duplicate the caller thread's handle here.
3449         (Bug#12832)
3451 2012-11-16  Jan Djärv  <jan.h.d@swipnet.se>
3453         * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3454         called (Bug#12834).
3456 2012-11-16  Paul Eggert  <eggert@cs.ucla.edu>
3458         Remove no-longer-used pty_max_bytes variable.
3459         * process.c (pty_max_bytes): Remove; unused.
3460         (send_process): Do not set it.
3462 2012-11-15  Juanma Barranquero  <lekktu@gmail.com>
3464         * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3465         Update dependencies.
3467 2012-11-15  Paul Eggert  <eggert@cs.ucla.edu>
3469         * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3470         This follows up on the 2012-09-29 patch that removed indirection
3471         for the 'function' field.  Reported by Sergey Vinokurov in
3472         <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3474 2012-11-14  Eli Zaretskii  <eliz@gnu.org>
3476         * w32.c (faccessat): Rename from sys_faccessat.  (No need to use a
3477         different name, as the MS runtime does not have such a function,
3478         and probably never will.)  All callers changed.  Ignore DIRFD
3479         value if PATH is an absolute file name, to match Posix spec
3480         better.  If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3481         symlinks.
3483 2012-11-14  Dmitry Antipov  <dmantipov@yandex.ru>
3485         * xdisp.c (echo_area_display, redisplay_internal):
3486         Omit redundant check whether frame_garbaged is set.
3488 2012-11-14  Paul Eggert  <eggert@cs.ucla.edu>
3490         Use faccessat, not access, when checking file permissions (Bug#12632).
3491         This fixes a bug that has been present in Emacs since its creation.
3492         It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3493         which must set some sort of record.  (Torek's bug report was against
3494         a predecessor of GNU Emacs, but GNU Emacs happened to have the
3495         same common flaw.)  See Torek's Usenet posting
3496         "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3497         Posted: Fri Apr  8 14:18:56 1983.
3498         * Makefile.in (LIB_EACCESS): New macro.
3499         (LIBES): Use it.
3500         * callproc.c (init_callproc):
3501         * charset.c (init_charset):
3502         * fileio.c (check_existing, check_executable, check_writable)
3503         (Ffile_readable_p):
3504         * lread.c (openp, load_path_check):
3505         * process.c (allocate_pty):
3506         * xrdb.c (file_p):
3507         Use effective UID when checking permissions, not real UID.
3508         * callproc.c (init_callproc):
3509         * charset.c (init_charset):
3510         * lread.c (load_path_check, init_lread):
3511         Test whether directories are accessible, not merely whether they exist.
3512         * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3513         * fileio.c (check_existing, check_executable, check_writable)
3514         (Ffile_readable_p):
3515         Use symbolic names instead of integers for the flags, as they're
3516         portable now.
3517         (check_writable): New arg AMODE.  All uses changed.
3518         Set errno on failure.
3519         (Ffile_readable_p): Use faccessat, not stat + open + close.
3520         (Ffile_writable_p): No need to call check_existing + check_writable.
3521         Just call check_writable and then look at errno.  This saves a syscall.
3522         dir should never be nil; replace an unnecessary runtime check
3523         with an eassert.  When checking the parent directory of a nonexistent
3524         file, check that the directory is searchable as well as writable, as
3525         we can't create files in unsearchable directories.
3526         (file_directory_p): New function, which uses 'stat' on most platforms
3527         but faccessat with D_OK (for efficiency) if WINDOWSNT.
3528         (Ffile_directory_p, Fset_file_times): Use it.
3529         (file_accessible_directory_p): New function, which uses a single
3530         syscall for efficiency.
3531         (Ffile_accessible_directory_p): Use it.
3532         * xrdb.c (file_p): Use file_directory_p.
3533         * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3534         * lread.c (openp): When opening a file, use fstat rather than
3535         stat, as that avoids a permissions race.  When not opening a file,
3536         use file_directory_p rather than stat.
3537         (dir_warning): First arg is now a usage string, not a format.
3538         Use errno.  All uses changed.
3539         * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3540         that merely introduced a race.
3541         * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3542         changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3543         and similarly for the other O_* flags.
3544         * w32.c (sys_faccessat): Rename from sys_access and switch to
3545         faccessat's API.  All uses changed.
3546         * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3547         (magic_db): Rename from magic_file_p.
3548         (magic_db, search_magic_path): Return an XrmDatabase rather than a
3549         char *, so that we don't have to test for file existence
3550         separately from opening the file for reading.  This removes a race
3551         fixes a permission-checking problem, and simplifies the code.
3552         All uses changed.
3553         (file_p): Remove; no longer needed.
3555 2012-11-13  Dmitry Antipov  <dmantipov@yandex.ru>
3557         Omit glyphs initialization at startup.
3558         * dispnew.c (glyphs_initialized_initially_p): Remove.
3559         (adjust_frame_glyphs_initially): Likewise.  Adjust users.
3560         (Fredraw_frame): Move actual code from here...
3561         (redraw_frame): ...to here.  Add eassert.  Adjust comment.
3562         (Fredraw_display): Use redraw_frame.
3563         * xdisp.c (clear_garbaged_frames): Likewise.
3565 2012-11-13  Eli Zaretskii  <eliz@gnu.org>
3567         * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3568         passed to pint2str and pint2hrstr to be at most the size of the
3569         frame's decode_mode_spec_buffer.  This avoids crashes with very
3570         large values of FIELD_WIDTH argument to decode_mode_spec.
3571         (Bug#12867)
3573 2012-11-13  Paul Eggert  <eggert@cs.ucla.edu>
3575         Fix a race with verify-visited-file-modtime (Bug#12863).
3576         Since at least 1991 Emacs has ignored an mtime difference of no
3577         more than one second, but my guess is that this was to work around
3578         file system bugs that were fixed long ago.  Since the race is
3579         causing problems now, let's remove that code.
3580         * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3581         whose time stamp is off by no more than a second.  Insist that the
3582         file time stamps match exactly.
3584 2012-11-12  Dmitry Antipov  <dmantipov@yandex.ru>
3586         * frame.h (struct frame): Convert external_tool_bar member to
3587         1-bit unsigned bitfield.
3588         * termhooks.h (struct terminal): Remove mouse_moved member since
3589         all users are long dead.  Adjust comment on mouse_position_hook.
3591 2012-11-12  Dmitry Antipov  <dmantipov@yandex.ru>
3593         Simplify by using FOR_EACH_FRAME here and there.
3594         * frame.c (next_frame, prev_frame, other_visible_frames)
3595         (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3596         * w32term.c (x_window_to_scroll_bar): Likewise.
3597         * window.c (window_list): Likewise.
3598         * xdisp.c (x_consider_frame_title): Likewise.
3599         * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3600         * xfns.c (x_window_to_frame, x_any_window_to_frame)
3601         (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3602         * xmenu.c (menubar_id_to_frame): Likewise.
3603         * xselect.c (frame_for_x_selection): Likewise.
3604         * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3605         (x_window_to_menu_bar): Likewise.
3606         * w32fns.c (x_window_to_frame): Likewise.  Adjust comment.
3608 2012-11-12  Paul Eggert  <eggert@cs.ucla.edu>
3610         * data.c (Qdefalias_fset_function): Now static.
3612         Another tweak to vectorlike_header change.
3613         * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3614         Remove, and replace all uses with ...
3615         (next_in_free_list, set_next_in_free_list):
3616         New functions, which respect C's aliasing rules better.
3618 2012-11-11  Paul Eggert  <eggert@cs.ucla.edu>
3620         * window.c (list4i): Rename from 'quad'.  All uses changed.
3621         Needed because <sys/types.h> defines 'quad' on Solaris 10.
3623 2012-11-11  Juanma Barranquero  <lekktu@gmail.com>
3625         * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3626         warning about mixing declarations and code in ISO C90.
3628 2012-11-10  Martin Rudalics  <rudalics@gmx.at>
3630         * window.c (Fsplit_window_internal): Set combination limit of
3631         new parent window to t iff Vwindow_combination_limit is t;
3632         fixing a regression introduced with the change from 2012-09-22.
3633         (Fset_window_combination_limit): Fix doc-string.
3635 2012-11-10  Eli Zaretskii  <eliz@gnu.org>
3637         * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3638         amount when the scroll margins are too large.  When scrolling
3639         backwards in the buffer, give up if cannot reach point or the
3640         scroll margin within a reasonable number of screen lines.
3641         Fixes point position in window under scroll-up/down-aggressively when
3642         point is positioned many lines beyond the window top/bottom.
3643         (Bug#12811)
3645         * ralloc.c (relinquish): If real_morecore fails to return memory
3646         to the system, don't crash; instead, leave the last heap
3647         unchanged and return.  (Bug#12774)
3649 2012-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>
3651         * lisp.h (AUTOLOADP): New macro.
3652         * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3653         * data.c (Ffset): Remove special ad-advice-info handling.
3654         (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3655         (Fsubr_arity): CSE.
3656         (Finteractive_form): Simplify.
3657         (Fquo): Don't insist on having at least 2 arguments.
3658         (Qdefalias_fset_function): New var.
3660 2012-11-09  Jan Djärv  <jan.h.d@swipnet.se>
3662         * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3664         * nsfont.m (Qcondensed, Qexpanded): New variables.
3665         (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3666         (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3668 2012-11-09  Dmitry Antipov  <dmantipov@yandex.ru>
3670         Fix recently introduced crash on MS-Windows (Bug#12839).
3671         * w32term.h (struct scroll_bar): Use convenient header.
3672         (SCROLL_BAR_VEC_SIZE): Remove.
3673         * w32term.c (x_scroll_bar_create): Use VECSIZE.
3675 2012-11-09  Dmitry Antipov  <dmantipov@yandex.ru>
3677         Tweak last vectorlike_header change.
3678         * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3679         vectorlike object on the free list.  This is introduced to avoid
3680         some (but not all) pointer casting and aliasing problems, see
3681         http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3682         * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3683         objects.
3684         (xvectype, xvecsize): Use them to examine Lisp_Object values.
3686 2012-11-09  Jan Djärv  <jan.h.d@swipnet.se>
3688         * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
3689         been removed, so remove them here also.
3691 2012-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>
3693         * doc.c (Fdocumentation): Handle new property
3694         dynamic-docstring-function to replace the old ad-advice-info.
3696 2012-11-09  Paul Eggert  <eggert@cs.ucla.edu>
3698         * fns.c (Qeql, hashtest_eq): Now static.
3700 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
3702         * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3703         * fns.c (hashfn_eq, hashfn_eql, sxhash):
3704         * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3705         * buffer.c (compare_overlays): Use XLI rather than XHASH.
3707 2012-11-08  Paul Eggert  <eggert@cs.ucla.edu>
3709         Use same hash function for hashfn_profiler as for hash_string etc.
3710         * fns.c (SXHASH_COMBINE): Remove.  All uses replaced by sxhash_combine.
3711         * lisp.h (sxhash_combine): New inline function, with the contents
3712         of the old SXHASH_COMBINE.
3713         * profiler.c (hashfn_profiler): Use it, instead of having a
3714         special hash function containing a comparison that always yields 1.
3716 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
3718         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3719         (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3720         (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3721         Remove unused vars.
3723 2012-11-08  Jan Djärv  <jan.h.d@swipnet.se>
3725         * image.c (xpm_make_color_table_h): Fix compiler error because
3726         make_hash_table changed.
3728 2012-11-08  Thomas Kappler  <tkappler@gmail.com>  (tiny change)
3730         * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3732 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
3734         Use ad-hoc comparison function for the profiler's hash-tables.
3735         * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3736         (make_log): Use them.
3737         (handle_profiler_signal): Don't inhibit quit any longer since we don't
3738         call Fequal any more.
3739         (Ffunction_equal): New function.
3740         (cmpfn_profiler, hashfn_profiler): New functions.
3741         (syms_of_profiler): Initialize them.
3742         * lisp.h (struct hash_table_test): New struct.
3743         (struct Lisp_Hash_Table): Use it.
3744         * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3745         * fns.c (make_hash_table): Take a struct to describe the test.
3746         (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3747         (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3748         (hash_lookup, hash_remove_from_table): Move assertion checking of
3749         hashfn result here.  Check hash-equality before calling cmpfn.
3750         (Fmake_hash_table): Adjust call to make_hash_table.
3751         (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3752         (syms_of_fns): Initialize them.
3753         * emacs.c (main): Move syms_of_fns earlier.
3754         * xterm.c (syms_of_xterm):
3755         * category.c (hash_get_category_set): Adjust call to make_hash_table.
3756         * print.c (print_object): Adjust to new hash-table struct.
3757         * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3759 2012-11-08  Eli Zaretskii  <eliz@gnu.org>
3761         * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3762         value of w32-scroll-lock-modifier is neither nil nor one of the
3763         known key modifiers.  (Bug#12806)
3765 2012-11-08  Dmitry Antipov  <dmantipov@yandex.ru>
3767         Shrink struct vectorlike_header to the only size field.
3768         * lisp.h (enum pvec_type): Avoid explicit enum member values.
3769         Adjust comment.
3770         (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3771         PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3772         (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3773         (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3774         information from the vector header.  Adjust comment.
3775         (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3776         (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3777         layout.
3778         (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3779         (struct vectorlike_header): Remove next member.  Adjust comment.
3780         (struct Lisp_Subr): Add convenient header.  Adjust comment.
3781         (allocate_pseudovector): Adjust prototype.
3782         * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3783         (sweep_string, lisp_malloc): Remove useless prototypes.
3784         (enum mem_type): Adjust comment.
3785         (NEXT_IN_FREE_LIST): New macro.
3786         (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3787         (Fmake_bool_vector): Likewise.
3788         (struct large_vector): New type to represent allocation unit for
3789         the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3790         (large_vectors): Change type to struct large_vector.
3791         (allocate_vector_from_block): Simplify.
3792         (PSEUDOVECTOR_NBYTES): Replace with...
3793         (vector_nbytes): ...new function.  Adjust users.
3794         (sweep_vectors): Adjust processing of large vectors.
3795         (allocate_vectorlike): Likewise.
3796         (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3797         Add easserts.  Adjust XSETPVECTYPESIZE usage.
3798         (allocate_buffer): Use BUFFER_PVEC_INIT.
3799         (live_vector_p): Adjust to match large vector.
3800         * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3801         * buffer.h (struct buffer): Add next member.
3802         (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3803         New macros.
3804         (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3805         * fns.c (internal_equal): Adjust to match enum pvec_type change.
3806         (copy_hash_table): Adjust to match vector header change.
3807         * lread.c (defsubr): Use XSETPVECTYPE.
3808         * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3809         (xvectype): Likewise.  Print PVEC_NORMAL_VECTOR for regular vectors.
3810         (xvecsize): New command.
3812 2012-11-08  Dmitry Antipov  <dmantipov@yandex.ru>
3814         * keyboard.c (event_to_kboard): Do not dereference
3815         frame_or_window field of SELECTION_REQUEST_EVENT
3816         and SELECTION_CLEAR_EVENT events (Bug#12814).
3817         * xterm.h (struct selection_input_event): Adjust comment.
3819 2012-11-07  Eli Zaretskii  <eliz@gnu.org>
3821         * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3822         such as Scroll Lock, if the respective keys are treated as
3823         function keys, not as modifiers.  This avoids destroying non-ASCII
3824         keyboard input when Scroll Lock is toggled ON.  (Bug#12806)
3826 2012-11-07  Dmitry Antipov  <dmantipov@yandex.ru>
3828         * xfns.c (Fx_wm_set_size_hint): Use check_x_frame.  Adjust docstring.
3830 2012-11-06  Paul Eggert  <eggert@cs.ucla.edu>
3832         Restore some duplicate definitions (Bug#12814).
3833         This undoes part of the 2012-11-03 changes.  Some people build
3834         with plain -g rather than with -g3, and they need the duplicate
3835         definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3836         * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3837         Define as macros, as well as as enums or as constants.
3839 2012-11-06  Jan Djärv  <jan.h.d@swipnet.se>
3841         * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3842         to keypad keys (Bug#12816).
3844 2012-11-06  Paul Eggert  <eggert@cs.ucla.edu>
3846         Minor adjustments of recently-changed frame functions.
3847         * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3848         known to be a frame (we're in the FRAMEP branch).
3849         * lisp.h (Qframep): Remove decl.  frame.h declares this.
3850         * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3851         since they're meant for Lisp fixnum values.
3853 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
3855         * window.c (Fwindow_combination_limit): Revert to the only
3856         required argument and adjust docstring as suggested in
3857         http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3858         by Martin Rudalics <rudalics@gmx.at>.
3860 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
3862         Widely used frame validity and checking functions.
3863         * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3864         * frame.c (decode_live_frame, decode_any_frame): New functions.
3865         (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3866         (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3867         (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3868         (Fframe_pointer_visible_p): Use decode_any_frame.
3869         (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3870         (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3871         (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3872         (Fframe_focus): Likewise.  Allow zero number of arguments.
3873         Adjust docstring.
3874         (frame_buffer_list, frame_buffer_predicate): Remove.
3875         * lisp.h (frame_buffer_predicate): Remove prototype.
3876         * buffer.c (Fother_buffer): Use decode_any_frame.
3877         * xdisp.c (Ftool_bar_lines_needed): Likewise.
3878         * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3879         * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3880         (Fclose_font, Ffont_info): Use decode_live_frame.
3881         * fontset.c (check_fontset_name): Likewise.
3882         * terminal.c (Fframe_terminal): Likewise.
3883         * w32fns.c (check_x_frame): Likewise.
3884         * window.c (Fminibuffer_window, Fwindow_at)
3885         (Fcurrent_window_configuration): Likewise.
3886         (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3887         Likewise.  Allow zero number of arguments.  Adjust docstring.
3888         * dispnew.c (Fredraw_frame): Likewise.
3889         * xfaces.c (frame_or_selected_frame): Remove.
3890         (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3891         (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3892         (Fframe_face_alist): Use decode_live_frame.
3893         * xfns.c (check_x_frame): Likewise.
3895 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
3897         * window.c (quad): New function.
3898         (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3899         (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3900         (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3901         (Fwindow_line_height): Use it.
3902         (Fwindow_fringes): Use list3.
3903         (Fwindow_scroll_bars): Use list4.
3904         (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3905         (Fwindow_combination_limit): Allow zero number of arguments.
3907 2012-11-05  Eli Zaretskii  <eliz@gnu.org>
3909         * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3911         * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
3912         (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
3913         file descriptor 2 for standard error.  (Bug#12805)
3915 2012-11-05  Chong Yidong  <cyd@gnu.org>
3917         * process.c (wait_reading_process_output): Revert previous change.
3919 2012-11-05  Paul Eggert  <eggert@cs.ucla.edu>
3921         Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3922         This removes code that has been obsolete since around 1990.
3923         * callproc.c (Fcall_process):
3924         * emacs.c (main):
3925         * process.c (create_process):
3926         * term.c (dissociate_if_controlling_tty):
3927         Assume setsid exists.
3928         * callproc.c (child_setup): Assume setpgid exists and behaves as
3929         per POSIX.1-1988 or later.
3930         * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3931         * emacs.c (shut_down_emacs):
3932         * sysdep.c (sys_suspend, init_foreground_group):
3933         Assume getpgrp behaves as per POSIX.1-1998 or later.
3934         * msdos.c (setpgrp): Remove.
3935         (tcgetpgrp, setpgid, setsid): New functions.
3936         * systty.h (EMACS_GETPGRP): Remove.  All callers now use getpgrp.
3937         * term.c (no_controlling_tty): Remove; unused.
3938         * w32proc.c (setpgrp): Remove.
3939         (setsid, tcgetpgrp): New functions.
3941         Simplify by assuming __fpending.
3942         * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3943         (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3944         Do not assume that __fpending's result fits in int.
3946 2012-11-04  Paul Eggert  <eggert@cs.ucla.edu>
3948         Remove EMACS_OUTQSIZE+sleep hack.
3949         * dispnew.c (update_frame_1): Remove hack for terminals slower
3950         than 2400 bps, which throttled Emacs by having it sleep.
3951         This code hasn't worked since at least 2007, when the multi-tty stuff
3952         was added, and anyway those old terminals are long dead.
3953         * systty.h (EMACS_OUTQSIZE): Remove; unused.  The macro isn't used even
3954         without the dispnew.c change, as dispnew.c doesn't include systty.h.
3956         Fix data-loss with --version (Bug#9574).
3957         * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3958         as we can't assume that emacs_strerror is initialized, and strerror
3959         is good enough here.
3960         (main): Invoke atexit earlier, to catch earlier instances of
3961         sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3963 2012-11-04  Michael Marchionna  <tralfaz@pacbell.net>
3965         * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3966         (keyDown): Remap keypad keys to X11 virtual key codes.
3968 2012-11-03  Paul Eggert  <eggert@cs.ucla.edu>
3970         Fix data-loss with --batch (Bug#9574).
3971         * emacs.c: Include <close-stream.h>.
3972         (close_output_streams): New function.
3973         (main): Pass it to atexit, so that Emacs closes stdout and stderr
3974         and handles errors appropriately.
3975         (Fkill_emacs): Don't worry about flushing, as close_output_stream
3976         does that now.
3978         Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3979         The symptom is a diagnostic "GLib-WARNING **: In call to
3980         g_spawn_sync(), exit status of a child process was requested but
3981         SIGCHLD action was set to SIG_IGN and ECHILD was received by
3982         waitpid(), so exit status can't be returned."  The diagnostic
3983         is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3984         The real bug is a race condition between Emacs and glib: Emacs
3985         does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3986         so that glib can't find it.  Work around the bug by invoking
3987         waitpid only on subprocesses that Emacs itself creates.
3988         * process.c (create_process, record_child_status_change):
3989         Don't use special value -1 in pid field, as the caller now must
3990         know the pid rather than having the callee infer it.
3991         The inference was sometimes incorrect anyway, due to another race.
3992         (create_process): Set new 'alive' member if child is created.
3993         (process_status_retrieved): New function.
3994         (record_child_status_change): Use it.
3995         Accept negative 1st argument, which means to wait for the
3996         processes that Emacs already knows about.  Move special-case code
3997         for DOS_NT (which lacks WNOHANG) here, from caller.  Keep track of
3998         processes that have already been waited for, by testing and
3999         clearing new 'alive' member.
4000         (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4001         now does this internally.
4002         (handle_child_signal): Let record_child_status_change do all
4003         the work, since we do not want to reap all exited child processes,
4004         only the child processes that Emacs itself created.
4005         * process.h (Lisp_Process): New boolean member 'alive'.
4007         Omit duplicate definitions no longer needed with gcc -g3.
4008         * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4009         (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4010         Define only as macros.  There's no longer any need to also define
4011         these symbols as enums or as constants, since we now assume
4012         gcc -g3 when debugging.
4014 2012-11-03  Eli Zaretskii  <eliz@gnu.org>
4016         * lisp.mk: Adjust comments to the fact that term/internal is now
4017         loaded from loadup.el.
4019         * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4020         (msdos_fatal_signal): New function.
4021         (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4022         its argument list.
4024         * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4025         for GCC versions before 4.
4026         (emacs_raise): Define to call msdos_fatal_signal.
4028         * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4029         iterator when starting in the middle of a display or overlay
4030         string.  (Bug#12745)
4032 2012-11-03  Chong Yidong  <cyd@gnu.org>
4034         * process.c (wait_reading_process_output): Clean up the last
4035         change.
4037 2012-11-03  Jim Paris  <jim@jtan.com>  (tiny change)
4039         * process.c (wait_reading_process_output): Avoid a race condition
4040         with SIGIO delivery (Bug#11536).
4042 2012-11-03  Chong Yidong  <cyd@gnu.org>
4044         * buffer.c (cursor_type): Untabify docstring.
4046 2012-11-03  Dmitry Antipov  <dmantipov@yandex.ru>
4048         * frame.h (struct frame): Drop can_have_scroll_bars member
4049         which is meaningless for a long time.  Adjust comments.
4050         (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4051         * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4053 2012-11-03  Dmitry Antipov  <dmantipov@yandex.ru>
4055         * window.c (decode_next_window_args): Update window arg after
4056         calling decode_live_window and so fix crash reported at
4057         http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4058         by Juanma Barranquero <lekktu@gmail.com>.
4059         (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4060         * font.c (Ffont_at): Likewise.
4062 2012-11-01  Jan Djärv  <jan.h.d@swipnet.se>
4064         * widget.c (resize_cb): New function.
4065         (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4066         (EmacsFrameResize): Check if all is up to date before changing frame
4067         size.
4069 2012-11-02  Eli Zaretskii  <eliz@gnu.org>
4071         Implement backtrace output for fatal errors on MS-Windows.
4072         * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4073         (BACKTRACE_LIMIT_MAX): New macro.
4074         (w32_backtrace): New function.
4075         (emacs_abort): Use w32_backtrace when the user chooses not to
4076         attach a debugger.  Update the text of the abort dialog.
4078 2012-11-02  Dmitry Antipov  <dmantipov@yandex.ru>
4080         Window-related stuff cleanup here and there.
4081         * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4082         Use decode_any_window.
4083         * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4084         * xdisp.c (Fformat_mode_line): Likewise.
4085         * font.c (Ffont_at): Use decode_live_window.
4086         * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4087         * window.c (decode_next_window_args): Likewise.
4088         (decode_any_window): Remove static.
4089         * window.h (decode_any_window): Add prototype.
4090         * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4091         * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4092         respectively.
4094 2012-11-02  Dmitry Antipov  <dmantipov@yandex.ru>
4096         Remove pad from struct input_event.
4097         * termhooks.h (struct input_event): Remove padding field.
4098         Adjust comment.
4099         * keyboard.c (event_to_kboard): Simplify because frame_or_window
4100         member is never cons for a long time.  Adjust comment.
4101         (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4102         SELECTION_CLEAR_EVENT has no Lisp_Objects to mark.  Add comment.
4103         * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4104         field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4106 2012-11-01  Eli Zaretskii  <eliz@gnu.org>
4108         * w32proc.c (getpgrp, setpgid): New functions.  (Bug#12776)
4110 2012-10-31  Paul Eggert  <eggert@cs.ucla.edu>
4112         Fix crash when using Emacs as commit editor for git (Bug#12697).
4113         * callproc.c (setpgrp): Remove macro, as we now use setpgid
4114         and it is configured in conf_post.h.
4115         (Fcall_process): Don't invoke both setsid and setpgid; the former
4116         is enough, if it exists.
4117         * callproc.c (Fcall_process, child_setup):
4118         * process.c (create_process): Use setpgid.
4119         * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4120         for the real thing.
4121         * dispnew.c (init_display): Initialize the foreground group
4122         if we are running a tty display.
4123         * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4124         * lisp.h (init_foreground_group): New decl.
4125         * sysdep.c (inherited_pgroup): New static var.
4126         (init_foreground_group, tcsetpgrp_without_stopping)
4127         (narrow_foreground_group, widen_foreground_group): New functions.
4128         (init_sys_modes): Narrow foreground group.
4129         (reset_sys_modes): Widen foreground group.
4131 2012-10-31  Michael Albinus  <michael.albinus@gmx.de>
4133         * dbusbind.c: Fix cut'n'waste error.  Use HAVE_DBUS_VALIDATE_INTERFACE.
4135 2012-10-31  Martin Rudalics  <rudalics@gmx.at>
4137         * minibuf.c (read_minibuf): Restore current buffer since
4138         choose_minibuf_frame calling Fset_frame_selected_window may
4139         change it (Bug#12766).
4141 2012-10-30  Jan Djärv  <jan.h.d@swipnet.se>
4143         * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4145 2012-10-30  Kenichi Handa  <handa@gnu.org>
4147         * font.c (Ffont_at): If WINDOW is specified and it is not
4148         displaying the current buffer, signal an error.
4150 2012-10-29  Daniel Colascione  <dancol@dancol.org>
4152         * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4153         In preparation for fixing bug#12739, move these functions from
4154         here...
4156         * coding.h, coding.c: ... to here, and compile them only when
4157         WINDOWSNT or CYGWIN.  Moving these functions out of cygw32 proper
4158         lets us write cygw32-agnostic code for the HAVE_NTGUI case.
4160 2012-10-28  Eli Zaretskii  <eliz@gnu.org>
4162         * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4163         (timer_loop, getitimer, setitimer): Use it instead of
4164         CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4165         'clock'.
4166         (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4167         literal 10000.
4169 2012-10-28  Jan Djärv  <jan.h.d@swipnet.se>
4171         * nsterm.m (NO_APPDEFINED_DATA): New define.
4172         (last_appdefined_event_data): New variable
4173         (last_appdefined_event): Remove.
4174         (ns_select): Initialize t from last_appdefined_event_data instead
4175         of [last_appdefined_event data1].
4176         (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4177         remove last_appdefined_event (Bug#12698).
4179 2012-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
4181         * frame.c (x_set_font): Catch internal error.
4183 2012-10-27  Eli Zaretskii  <eliz@gnu.org>
4185         Avoid overflow in w32 implementation of interval timers.
4186         When possible, for ITIMER_PROF count only times the main thread
4187         actually executes.
4188         * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
4189         'volatile ULONGLONG' types.  All the other data which was
4190         previously clock_t is now ULONGLONG.  'terminate' is 'volatile int'.
4191         (GetThreadTimes_Proc): New typedef.
4192         (w32_get_timer_time): New function, returns a suitable time value
4193         for the timer.
4194         (timer_loop): Enter critical section when accessing ULONGLONG
4195         values of the itimer_data struct, as these accesses are no longer
4196         atomic.  Call 'w32_get_timer_time' instead of 'clock'.
4197         Remove unused variable.
4198         (init_timers): Initialize s_pfn_Get_Thread_Times.
4199         (start_timer_thread): Don't assign itimer->caller_thread here.
4200         (getitimer): Assign itimer->caller_thread here.
4201         (setitimer): Always call getitimer to get the value of ticks_now.
4202         (sys_spawnve): Avoid compiler warning about format mismatch.
4204 2012-10-26  Eli Zaretskii  <eliz@gnu.org>
4206         * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4207         mouse movement events if the menu bar is active.  This avoids
4208         producing a busy "hour-glass" cursor by Windows if the mouse
4209         pointer is positioned over a tooltip shown for some menu item.
4211 2012-10-25  Paul Eggert  <eggert@cs.ucla.edu>
4213         Don't assume process IDs fit in int.
4214         * emacs.c (shut_down_emacs) [!DOS_NT]:
4215         * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4216         * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4217         Use pid_t, not int, to store process IDs, as 'int'
4218         is not wide enough on a few platforms (e.g., AIX and IRIX).
4220 2012-10-23  Kenichi Handa  <handa@gnu.org>
4222         The following change is to make face-font-rescale-alist work
4223         correctly for non-ASCII fonts.
4225         * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4226         (font_open_for_lface): Handle Vface_font_rescale_alist.
4228 2012-10-23  Chong Yidong  <cyd@gnu.org>
4230         * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4232 2012-10-21  Jan Djärv  <jan.h.d@swipnet.se>
4234         * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4235         for screen font.
4236         (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4238         * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4239         event (Bug#12681).
4241 2012-10-21  Glenn Morris  <rgm@gnu.org>
4243         * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4245 2012-10-20  Paul Eggert  <eggert@cs.ucla.edu>
4247         Port to OpenBSD 5.1.
4248         * frame.c (Fmouse_position, Fmouse_pixel_position):
4249         * xdisp.c (produce_stretch_glyph):
4250         Declare local vars only when they're needed.
4251         This is clearer and avoids a warning on OpenBSD about unused vars.
4252         * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4253         This is safer, and avoids OpenBSD warnings about unused vars.
4254         * keyboard.c (record_menu_key): Remove unnecessary decl.
4255         (poll_timer): Define only if POLL_FOR_INPUT is defined.
4256         * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4257         as our definition clashes with OpenBSD's.
4258         * xfaces.c (load_face_colors, check_lface_attrs)
4259         (get_lface_attributes_no_remap, get_lface_attributes)
4260         (lface_fully_specified_p, x_supports_face_attributes_p)
4261         (tty_supports_face_attributes_p, face_fontset, realize_face)
4262         (realize_x_face, realize_tty_face):
4263         Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4264         merely Lisp_Object *.  This is more informative and avoids
4265         a warning on OpenBSD about accessing beyond an object's size.
4267 2012-10-20  Chong Yidong  <cyd@gnu.org>
4269         * lread.c (Fload): Doc fix (Bug#12592).
4271 2012-10-19  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
4273         * font.c (Ffont_at): Fix previous change.
4275 2012-10-19  Eli Zaretskii  <eliz@gnu.org>
4277         * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4278         See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
4279         for the reasons.
4281         * alloc.c (NSTATICS): Decrease to 0x800.
4283 2012-10-19  Stefan Monnier  <monnier@iro.umontreal.ca>
4285         * fns.c (Fnreverse): Include the problem element when signaling an
4286         error (bug#12677).
4288 2012-10-18  Jan Djärv  <jan.h.d@swipnet.se>
4290         * nsterm.m (ns_select): Check writefds before call to
4291         FD_ISSET (Bug#12668).
4293 2012-10-18  Daniel Colascione  <dancol@dancol.org>
4295         * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4296         (staticpro): If we run out of staticpro slots, die with an
4297         informative error instead of just calling emacs_abort.
4299 2012-10-18  Martin Rudalics  <rudalics@gmx.at>
4301         Fix two flaws reported by Dmitry Antipov.
4302         * window.c (Ftemp_output_buffer_show): Remove.
4303         (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4304         (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4306 2012-10-17  Eli Zaretskii  <eliz@gnu.org>
4308         * makefile.w32-in ($(BLD)/w32.$(O)):
4309         ($(BLD)/vm-limit.$(O)):
4310         ($(BLD)/term.$(O)):
4311         ($(BLD)/unexw32.$(O)):
4312         ($(BLD)/fileio.$(O)):
4313         ($(BLD)/dispnew.$(O)): Update dependencies.
4315         * w32term.h (w32_initialize_display_info, initialize_w32_display):
4316         Add prototypes.
4318         * w32proc.c: Include ctype.h.
4320         * w32.h (init_environment, check_windows_init_file)
4321         (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4322         (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4323         (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4324         (sys_link): Add prototypes.
4326         * w32.c: Include w32select.h.
4327         (sys_access, e_malloc, sys_select): Add prototypes.
4328         (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4330         * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4332         * unexw32.c: Include lisp.h and w32.h.
4334         * term.c [WINDOWSNT]: Include w32term.h.
4336         * process.c [WINDOWSNT]: Add prototype of sys_select.
4338         * fileio.c [WINDOWSNT]: Include w32.h.
4340         * dispnew.c [WINDOWSNT]: Include w32.h.
4342         * cygw32.c (Fcygwin_convert_path_to_windows)
4343         (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4344         Lisp_Object values.  (Bug#12661)
4346         * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4347         to Lisp_Object.  (Bug#12661)
4349 2012-10-17  Kenichi Handa  <handa@gnu.org>
4351         * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4352         invalidate.
4354 2012-10-17  Dmitry Antipov  <dmantipov@yandex.ru>
4356         * buffer.c (Fkill_buffer): When unchaining the marker,
4357         reset its buffer pointer to NULL (Bug#12652).
4359 2012-10-17  Dmitry Antipov  <dmantipov@yandex.ru>
4361         Do not verify indirection counters of killed buffers (Bug#12579).
4362         * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4363         * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4365 2012-10-16  Dmitry Antipov  <dmantipov@yandex.ru>
4367         * alloc.c (Fmake_byte_code): Fix typo in comment.
4368         * print.c (print_interval): Define as static to match prototype.
4369         * indent.c (disptab_matches_widthtab, recompute_width_table):
4370         Convert to eassert.
4372 2012-10-16  Dmitry Antipov  <dmantipov@yandex.ru>
4374         * editfns.c (get_system_name): Remove.
4375         * lisp.h (get_system_name): Remove prototype.
4376         * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4377         (get_environ_db): Use Vsystem_name.  Avoid call to strlen.
4379 2012-10-15  Daniel Colascione  <dancol@dancol.org>
4381         * dbusbind.c: Add comment explaining reason for previous change.
4383 2012-10-15  Martin Rudalics  <rudalics@gmx.at>
4385         * window.c (Fwindow_end): Rewrite check whether cached position
4386         can be used (Bug#12600).
4387         (resize_frame_windows, grow_mini_window, shrink_mini_window):
4388         Set windows_or_buffers_changed.
4390 2012-10-15  Daniel Colascione  <dancol@dancol.org>
4392         * dbusbind.c: Fix cygw32 build break when compiling with dbus
4393         enabled by undefining the symbol "interface", which the platform
4394         headers define to something incompatible.
4396 2012-10-14  Daniel Colascione  <dancol@dancol.org>
4398         * image.c (init_tiff_functions, init_imagemagick_functions)
4399         (init_svg_functions): Fix cygw32 build break by using these
4400         functions only when WINDOWSNT _and_ HAVE_NTGUI.
4402 2012-10-14  Jan Djärv  <jan.h.d@swipnet.se>
4404         * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4406 2012-10-13  Jan Djärv  <jan.h.d@swipnet.se>
4408         * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4410 2012-10-13  HANATAKA, Shinya  <bogytech@gmail.com>  (tiny change)
4412         * coding.c (detect_coding): Set coding->id before calling
4413         this->detector.
4415 2012-10-13  Andreas Schwab  <schwab@linux-m68k.org>
4417         * fileio.c: Formatting fixes.
4419 2012-10-13  Paul Eggert  <eggert@cs.ucla.edu>
4421         Fix some stat-related races.
4422         * fileio.c (Fwrite_region): Avoid race condition if a file is
4423         removed or renamed by some other process immediately after Emacs
4424         writes it but before Emacs stats it.  Do not assume that stat (or
4425         fstat) succeeds.
4426         * image.c (slurp_file): Resolve the file name with fopen + fstat
4427         rather than stat + fopen.
4428         (pbm_read_file) [0]: Remove unused code with stat race.
4429         * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4430         Remove ineffective code with stat race.
4432 2012-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
4434         * doc.c (get_doc_string): Don't signal an error if the file is missing.
4436 2012-10-12  Jan Djärv  <jan.h.d@swipnet.se>
4438         * nsterm.m (hold_event_q): New static variable.
4439         (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4440         ! q_event_ptr.
4441         (hold_event): New function.
4442         (ns_read_socket): If hold_event_q have events, store them and
4443         return (Bug#12384).
4444         (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4445         is zero (Bug#12384).
4447 2012-10-12  Juanma Barranquero  <lekktu@gmail.com>
4449         * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4451 2012-10-12  Eli Zaretskii  <eliz@gnu.org>
4453         * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4455         * fileio.c (check_existing): New function.
4456         (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4457         instead of calling 'stat', when what's needed is to check whether
4458         a file exists.  This avoids expensive system calls on MS-Windows.
4459         (Bug#12587)
4461         * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
4463         * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4464         determine whether a file exists and is not a directory.
4466         * lisp.h (check_existing): Add prototype.
4468 2012-10-12  Jan Djärv  <jan.h.d@swipnet.se>
4470         * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4472 2012-10-12  Glenn Morris  <rgm@gnu.org>
4474         * buffer.c (Fset_buffer): Doc fix.  (Bug#12624)
4476 2012-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
4478         * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4480         * eval.c (Fautoload): Remember previous autoload status in load-history.
4482 2012-10-11  Paul Eggert  <eggert@cs.ucla.edu>
4484         lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4485         * lread.c (load_each_byte, new_backquote_flag, readchar)
4486         (read_filtered_event, lisp_file_lexically_bound_p)
4487         (safe_to_load_version, Fload, complete_filename_p, openp)
4488         (build_load_history, readevalloop, read_escape, read1)
4489         (string_to_number, read_vector, read_list):
4490         * macros.c (Fstart_kbd_macro):
4491         * marker.c (CONSIDER):
4492         * menu.c (parse_single_submenu, digest_single_submenu)
4493         (find_and_return_menu_selection, Fx_popup_menu):
4494         * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4495         (Ftry_completion):
4496         * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4497         (ns_menu_show):
4498         * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4499         (xmenu_show, xdialog_show):
4500         Use bool for booleans.
4501         * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4502         as it's not a predicate.  All uses changed.  Omit unnecessary
4503         buffer termination.
4505 2012-10-11  Dmitry Antipov  <dmantipov@yandex.ru>
4507         * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4508         (save_excursion_restore): Do not restore mark if it was not saved.
4510 2012-10-11  Paul Eggert  <eggert@cs.ucla.edu>
4512         * marker.c (cached_modiff): EMACS_INT, not int.
4514         * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4515         instead of having a wrong decl.
4516         * nsmenu.m (waiting_for_input): Remove wrong decl.
4518 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
4520         keyboard.c, keymap.c: Use bool for booleans.
4521         * dispnew.c (sit_for): Distinguish between 3-way display_option
4522         and boolean do_display.
4523         * keyboard.c (single_kboard, this_command_key_count_reset)
4524         (waiting_for_input, echoing, immediate_quit, input_pending)
4525         (interrupt_input, interrupts_deferred, pop_kboard)
4526         (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4527         (command_loop_1, adjust_point_for_property)
4528         (safe_run_hooks_error, input_polling_used, read_char):
4529         (help_char_p, readable_events, kbd_buffer_events_waiting)
4530         (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4531         (lucid_event_type_list_p, get_input_pending):
4532         (gobble_input, menu_separator_name_p, menu_bar_item)
4533         (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4534         (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4535         (keyremap_step, test_undefined, read_key_sequence)
4536         (detect_input_pending, detect_input_pending_ignore_squeezables)
4537         (detect_input_pending_run_timers, requeued_events_pending_p)
4538         (quit_throw_to_read_char, Fset_input_interrupt_mode):
4539         * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4540         (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4541         (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4542         (accessible_keymaps_1, Fkey_description, push_key_description):
4543         (shadow_lookup, struct where_is_internal_data)
4544         (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4545         (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4546         (describe_map, describe_vector):
4547         * menu.c (single_menu_item):
4548         * nsmenu.m (ns_update_menubar):
4549         * process.c (wait_reading_process_output):
4550         * search.c (scan_buffer, scan_newline):
4551         Use bool for boolean.
4552         * keyboard.c (timers_run, swallow_events)
4553         (detect_input_pending_run_timers):
4554         * process.c (wait_reading_process_output):
4555         Use unsigned for counter where wraparound-on-overflow is desired,
4556         since unsigned is guaranteed to have that behavior and signed is not.
4557         (read_char): Use ptrdiff_t for string length.
4558         (get_input_pending): Remove first argument, since it was always
4559         the same pointer-to-int (now pointer-to-boolean) &input_pending,
4560         and behave as if it had that value.  Return new value of
4561         input_pending.  All callers changed.
4562         * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4563         immediate_echo.  Use ptrdiff_t for echo_after_prompt, since it's
4564         a string length.
4565         * keymap.c (push_key_description): Omit last arg, which was always 1.
4566         All callers changed.
4568         * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4570 2012-10-10  Juanma Barranquero  <lekktu@gmail.com>
4572         * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4573         ($(BLD)/term.$(O)): Update dependencies.
4575 2012-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
4577         * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4578         * lisp.h (enum pvec_type): Adjust comments and omit explicit
4579         initializer for PVEC_NORMAL_VECTOR.
4581 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
4583         Clean out old termopts cruft.
4584         * termopts.h (flow_control, meta_key): Remove unused decls.
4585         * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4586         Don't include termopts.h.
4588 2012-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
4590         * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4592 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
4594         * commands.h (immediate_quit): Remove duplicate decl.
4596 2012-10-09  Jan Djärv  <jan.h.d@swipnet.se>
4598         * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4599         caching.
4600         (nsfont_open): Remove setting of Vfonts_in_cache.
4601         (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
4603 2012-10-09  Eli Zaretskii  <eliz@gnu.org>
4605         * w32fns.c (w32_last_error): Change the return value to DWORD, to
4606         match what GetLastError returns.  Explain why the function is
4607         needed.
4609         * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4610         'is_tooltip_frame', to avoid confusion with its global namesake.
4612 2012-10-08  Daniel Colascione  <dancol@dancol.org>
4614         * xdisp.c (start_hourglass): Call w32_note_current_window when
4615         HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4616         build that caused Emacs to display the hourglass cursor forever.
4618         * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4619         which is broken under remote desktop, calculate the number of
4620         colors available for a display based on the display's number of
4621         planes and number of bits per pixel per plane.  (bug#10397).
4623 2012-10-08  Jan Djärv  <jan.h.d@swipnet.se>
4625         * nsfont.m (Vfonts_in_cache): New variable.
4626         (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4627         are used.  Add cached fonts to Vfonts_in_cache.
4628         (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4630 2012-10-08  Juanma Barranquero  <lekktu@gmail.com>
4632         * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4633         in nt/config.nt.
4634         (FONT_H): Define after FRAME_H.
4635         ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4636         Update dependencies.
4638         * w32term.c: Remove leftover declaration of keyboard_codepage.
4640 2012-10-08  Eli Zaretskii  <eliz@gnu.org>
4642         * makefile.w32-in (FONT_H): Add $(FRAME_H).
4643         (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4644         ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4645         (GLOBAL_SOURCES): Add cygw32.c.
4646         ($(BLD)/unexw32.$(O)):
4647         ($(BLD)/w32.$(O)):
4648         ($(BLD)/w32console.$(O)):
4649         ($(BLD)/w32fns.$(O)):
4650         ($(BLD)/w32heap.$(O)):
4651         ($(BLD)/w32menu.$(O)):
4652         ($(BLD)/w32proc.$(O)): Add w32common.h.
4654         * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4655         'const char *'.
4656         (x_to_w32_color): Don't modify the argument, modify a copy instead.
4658 2012-10-08  Daniel Colascione  <dancol@dancol.org>
4660         * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4661         (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4662         accidental message numbering hole.  Change other messages to
4663         match.
4665         * w32select.h (HAVE_W32SELECT): Remove.
4667         * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
4668         w32common.h instead of w32heap.h.
4670         * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4671         (get_allocation_unit, get_processor_type, get_w32_major_version)
4672         (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4673         (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4674         (OS_NT, os_subtype, cache_system_info): Move declarations to
4675         w32common.
4677         * w32heap.c: Include w32common.h.
4678         (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
4679         (w32_minor_version, w32_build_number, w32_subtype):
4680         Remove duplicate definitions.
4682         * w32fns.c: Include w32common.h; include w32heap.h only in
4683         WINDOWSNT.
4685         (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4686         Use `report_file_error' instead of `error' in order to better
4687         inform users of what went wrong.  Increase NTGUI_UNICODE file
4688         dialog box file name length to 32k, the maximum allowed by the NT
4689         kernel.
4691         * w32common.h: New file.
4692         (ROUND_UP, ROUND_DOWN, get_page_size)
4693         (get_allocation_unit, get_processor_type, get_w32_major_version)
4694         (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4695         (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4696         (OS_NT, os_subtype, cache_system_info): Move here.
4698         * unexw32.c, unexcw.c: Include w32common.h.
4700         * emacs.c (main): Use (defined (WINDOWSNT) || defined
4701         HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4702         to call syms_of_w32select.
4704         * cygw32.h: Remove obsolete EXFUN declarations.
4706         * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4708         * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4709         of w32inevt.o from SOME_MACHINE_OBJECTS.
4711 2012-10-08  Daniel Colascione  <dancol@dancol.org>
4713         * image.c: Permanent fix for JPEG compilation issue --- limit
4714         jpeglib `boolean' redefinition to Cygwin builds.
4716 2012-10-08  Eli Zaretskii  <eliz@gnu.org>
4718         * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4720         * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4721         Cygwin.
4723 2012-10-08  Daniel Colascione  <dancol@dancol.org>
4725         * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4726         w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4727         w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4728         w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4729         keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4730         emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4731         Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4732         operating system.  defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4733         now a supported configuration.
4735         * Makefile.in: consolidate image variables into LIBIMAGE; add
4736         W32_OBJ and W32_LIBS.  Compile new files.
4738         * conf_post.h:
4739         (_DebPrint) declare tracing facility for W32 debugging.  We need
4740         to unify tracing later.
4742         (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4743         unconditional use of W32 Unicode functions.  Cygwin runs only on
4744         100% Unicode operating systems.
4746         * cygw32.c: New file.  Define Cygwin-specific facilities.
4747         (Fcygwin_convert_path_to_windows)
4748         (Fcygwin_convert_path_from_windows): New user functions for
4749         accessing Cygwin path-munging routines.
4751         * cygw32.h: New file.
4752         (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4753         UTF-16LE strings temporarily inside non-Lisp-visible string
4754         objects.
4756         (w32_strerror): Just what it says on the tin.
4758         * emacs.c: Make the NS fork-then-exec code for daemon-launching
4759         also run for Cygwin; both systems have the same problem with using
4760         GUI facilities in a forked child.  Also call syms_of_cygw32,
4761         syms_of_w32select in correct places.
4763         (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4764         needs fork-then-exec for daemon launching.
4766         * font.h: Include frame.h.
4768         * image.c: Use the image library cache machinery only when we're
4769         compiling for native WINDOWSNT; Cygwin can use shared libraries
4770         like any other Unixlike system.
4772         * keyboard.c: Clarify a comment regarding the input loop.
4774         * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4775         functions directly instead of trying to detect at runtime that our
4776         host operating system supports them.  We make this change for two
4777         reasons: Cygwin lacks support for the multibyte character
4778         conversion functions used by the legacy menu code, and Cygwin
4779         never needs to rely on non-Unicode APIs.
4781         * unexw32.c (hinst): Declare extern.
4783         * w32.c: Change header order;
4784         (w32_strerror): Move to w32fns.c because we need it for
4785         non-WINDOWSNT builds.
4787         * w32.h: Add #error macro to make sure we don't include w32.h for
4788         Cygwin builds.  Remove w32select declarations.
4790         * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
4791         w32fns.c.  w32console.c is WINDOWSNT-only.
4793         * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4794         NTGUI_UNICODE tweaks.  (See above.) Change _snprintf to the more
4795         POSIXy alternative.
4796         (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4797         (w32_major_version, w32_minor_version, w32_build_number)
4798         (os_subtype, sound_type): Define here
4799         (w32_defined_color): Make color parameter const for consistency
4800         with other _defined_color functions.
4801         (w32_createwindow): Unconditionally call w32_init_class instead of
4802         doing so only when hprevinst is non-NULL.  Plumbing hprevinst
4803         through the code is complex and unnecessary because class
4804         registration is practically free.
4805         (w32_name_of_message): New EMACSDEBUG-only function.
4806         (Fset_message_beep): Move here
4807         (Fx_open_connection): Require that the display name for Windows be
4808         "w32" for consistency, emacsclient disambiguation, and maybe, one
4809         day, multi-window-system support.
4810         (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4811         Cygwin files for W32 GUI facilities, since these clearly don't
4812         expect Cygwin names.
4813         (_DebPrint): Define.
4814         (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4815         (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4816         (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4817         (w32_last_error): Remove.
4819         * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4821         * w32heap.c (syspage_mask): Declare here.
4822         (cache_system_info): Remove.
4824         * w32inevt.c (faked_key): Define globally, not statically.
4825         (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4826         (w32_console_toggle_lock_key): Move to w32fns.c.
4828         * w32menu.c: Include setjmp.h.  NTGUI_UNICODE changes throughout.
4830         * w32proc.c (_DebPrint): Move to w32fns.c.
4831         * w32select.c: Include string.h, stdio.h for Cygwin.
4832         * w32select.h: New File.
4834         * w32term.c: Include io.h for non-CYGWIN builds; needed for
4835         get_osfhandle.
4836         (w32_message_fd): New variable.  Under Cygwin, holds the file
4837         descriptor the system used to tell us about pending thread
4838         messages.
4840         (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4841         that prevented compilation under non-WINDOWSNT systems.
4843         (w32_initialize): Open /dev/windows and assign it to
4844         w32_message_fd.  Provide w32 feature.
4846         * w32term.h: Include frame.h, atimer.h.  Declare various frame functions.
4847         (WM_EMACS_INPUT_READY): add.
4848         (prepend_msg, w32_message_fd): Declare globally.
4850         * w32xfns.c:
4851         (keyboard_handle): Use only when WINDOWSNT.
4852         (notify_msg_ready): New function.  Posts a message to the main
4853         thread's message queue under CYGWIN, which wakes up the main
4854         thread from select(2) by making the /dev/windows file descriptor
4855         ready.  Under WINDOWSNT, it sets an event the same way the old
4856         code did.
4858         (post, prepend_msg): Actually call notify_msg_ready instead of
4859         setting the input event directly.
4861 2012-10-07  Eli Zaretskii  <eliz@gnu.org>
4863         * ralloc.c (relinquish): If a heap is ready to be relinquished,
4864         but it still has blocs in it, don't return it to the system,
4865         instead of aborting.  (Bug#12402)
4867 2012-10-07  Jan Djärv  <jan.h.d@swipnet.se>
4869         * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
4871         * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4872         MAC_OS_X_VERSION_10_6.
4873         (syms_of_nsterm): Remove comment about Panther and above for
4874         ns-antialias-text.
4875         * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4876         (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4877         (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4879         * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4880         MAC_OS_X_VERSION_10_4.
4882         * nsmenu.m (fillWithWidgetValue:): Remove code for <
4883         MAC_OS_X_VERSION_10_2.
4885         * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4887         * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4888         (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4890         * nsterm.m (ns_in_resize): Remove (Bug#12479).
4891         (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
4892         (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4893         Remove ns_in_resize check.
4894         (ns_clear_frame_area): Remove resize handle code.
4896         * nsfns.m (ns_in_resize): Remove.
4897         (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4898         Remove ns_in_resize check.
4900 2012-10-07  Paul Eggert  <eggert@cs.ucla.edu>
4902         Improve sys_siglist detection.
4903         * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4904         defined as a macro, as is done in Solaris.
4905         (sys_siglist_entries): New macro.
4906         (save_strsignal): Use it.
4907         * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4908         GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4910 2012-10-06  Jan Djärv  <jan.h.d@swipnet.se>
4912         * nsfns.m (Fx_create_frame): Call x_default_parameter with
4913         fullscreen/Fullscreen.
4915         * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4916         tobar_height is new.
4918         * nsterm.m (x_make_frame_visible): Check for fullscreen.
4919         (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4920         (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4921         (windowDidResize:): Check for correct window if old style fullscreen.
4922         Capitalize word in comment.  Remove incorrect comment.
4923         (initFrameFromEmacs:): tbar_height renamed tibar_height.
4924         (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4925         error in drawing background.
4926         (toggleFullScreen:): Remove comment.  Rearrange calls.
4927         Set toolbar values to zero, save old height in tobar_height.
4928         Restore tool bar height when leaving fullscreen.
4929         (canBecomeMainWindow): New function.
4931 2012-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4933         * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4935 2012-10-05  Eli Zaretskii  <eliz@gnu.org>
4937         * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4939         * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
4940         that time stamps of directories could also be changed.
4941         Don't request the too broad GENERIC_WRITE, only the more restrictive
4942         FILE_WRITE_ATTRIBUTES access rights.
4944         * fileio.c (Fset_file_times): Special-case ignoring errors for
4945         directories only on MSDOS, not on MS-Windows.
4947 2012-10-05  Ikumi Keita  <ikumi@ikumi.que.jp>  (tiny change)
4949         * minibuf.c (Fcompleting_read): Doc fix.  (Bug#12555)
4951 2012-10-04  Eli Zaretskii  <eliz@gnu.org>
4953         * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4954         see whether CreateFile failed.
4956 2012-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4958         * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4959         to avoid similar races.
4960         * keyboard.c (pending_signals): Now bool, not int.
4962         Port timers to OpenBSD, plus check for timer failures.
4963         OpenBSD problem reported by Han Boetes.
4964         * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4965         and/or setitimer.
4966         (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4967         * syssignal.h (HAVE_ITIMERSPEC): New macro.  This is for platforms
4968         like OpenBSD, which has timer_settime but does not declare it.
4969         OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4970         whether to use itimerspec-related primitives.  All uses of
4971         HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4973 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
4975         * profiler.c (handle_profiler_signal): Fix a malloc race
4976         that caused Emacs to hang on Fedora 17 when profiling Lisp.
4978 2012-10-02  Jan Djärv  <jan.h.d@swipnet.se>
4980         * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4982 2012-10-02  Eli Zaretskii  <eliz@gnu.org>
4984         * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4985         consistent with the change in return value of 'safe_strsignal'.
4987 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
4989         Prefer plain 'static' to 'static inline' (Bug#12541).
4990         * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4991         (bidi_set_sor_type, bidi_push_embedding_level)
4992         (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4993         (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4994         (bidi_cache_search, bidi_cache_ensure_space)
4995         (bidi_cache_iterator_state, bidi_cache_find)
4996         (bidi_peek_at_next_level, bidi_set_paragraph_end)
4997         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4998         (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4999         Now 'static', not 'static inline'.
5001         Count overruns when profiling; change units to ns.
5002         * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5003         Give extra weight to samples after overruns, to attempt to count
5004         the time more accurately.
5005         (setup_cpu_timer): Change sampling interval units from ms to ns, since
5006         the underlying primitives nominally do ns.
5007         (Fprofiler_cpu_start): Document the change.  Mention that
5008         the sampling intervals are only approximate.
5010 2012-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
5012         * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5014         * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5015         case for the special 0 coding-system.
5017         * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5018         (Fmake_overlay): Remove redundant tests.
5019         (fix_start_end_in_overlays): Remove redundant recentering.
5021 2012-10-02  Juanma Barranquero  <lekktu@gmail.com>
5023         * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5024         Update dependencies.
5026 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5028         Fix a malloc race condition involving strsignal.
5029         A signal can arrive in the middle of a malloc, and Emacs's signal
5030         handler can invoke strsignal, which can invoke malloc, which is
5031         not portable.  This race condition bug makes Emacs hang on GNU/Linux.
5032         Fix it by altering the signal handler so that it does not invoke
5033         strsignal.
5034         * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5035         * process.c (status_message): Use const pointer, in case strsignal
5036         is #defined to safe_strsignal.
5037         * sysdep.c (sys_siglist, init_signals): Always define and
5038         initialize a substitute sys_siglist if the system does not define
5039         one, even if HAVE_STRSIGNAL.
5040         (safe_strsignal): Rename from strsignal.  Always define,
5041         using sys_siglist.  Return a const pointer.
5042         * syssignal.h (safe_strsignal): New decl.
5043         (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5045 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
5047         * w32proc.c (timer_loop): Fix code that waits for timer
5048         expiration, to avoid high CPU usage.
5050 2012-10-01  Stefan Monnier  <monnier@iro.umontreal.ca>
5052         * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5053         (sweep_weak_table): Remove redundant prototypes.
5055 2012-10-01  Fabrice Popineau  <fabrice.popineau@gmail.com>
5057         * emacs.c: Move the inclusion of TERM_HEADER after including
5058         windows.h on WINDOWSNT.  This avoids compilation problems with
5059         MSVC.
5061 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
5063         * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5064         (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5065         (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5066         as the previous version used 'void *'.
5068         * ralloc.c (ROUNDUP): Fix last change.
5069         (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5070         'size_t'.
5072         * w32proc.c <disable_itimers>: New static flag.
5073         (init_timers): Initialize it to zero, after creating the critical
5074         sections used by the timer threads.
5075         (term_timers): Set to 1 before deleting the critical sections.
5076         (getitimer, setitimer): If disable_itimers is non-zero, return an
5077         error indication without doing anything.  Reported by Fabrice
5078         Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
5079         (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5080         return results.
5081         [!HAVE_SETITIMER]: Behave as the previous version that didn't
5082         support timers.
5084         * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5085         term_ntproc after all the other bookkeeping, to get timers working
5086         as long as possible.
5088 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5090         * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5091         Suggested by Juri Linkov in
5092         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5094         Prefer plain 'static' to 'static inline' (Bug#12541).
5095         With static functions, modern compilers inline pretty well by
5096         themselves; advice from programmers often hurts as much as it helps.
5097         On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5098         this change shrinks the text size of the Emacs executable by 1.1%
5099         without affecting CPU significantly in my benchmark.
5100         * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5101         (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5102         (mark_maybe_object, mark_maybe_pointer, bounded_number):
5103         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5104         (bset_auto_fill_function, bset_auto_save_file_format)
5105         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5106         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5107         (bset_cache_long_line_scans, bset_case_fold_search)
5108         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5109         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5110         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5111         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5112         (bset_header_line_format, bset_indicate_buffer_boundaries)
5113         (bset_indicate_empty_lines, bset_invisibility_spec)
5114         (bset_left_fringe_width, bset_major_mode, bset_mark)
5115         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5116         (bset_name, bset_overwrite_mode, bset_pt_marker)
5117         (bset_right_fringe_width, bset_save_length)
5118         (bset_scroll_bar_width, bset_scroll_down_aggressively)
5119         (bset_scroll_up_aggressively, bset_selective_display)
5120         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5121         (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5122         (set_buffer_overlays_after):
5123         * category.c (bset_category_table):
5124         * charset.c (read_hex):
5125         * coding.c (produce_composition, produce_charset)
5126         (handle_composition_annotation, handle_charset_annotation)
5127         (char_encodable_p):
5128         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5129         (assign_row, set_frame_matrix_frame, make_current)
5130         (add_row_entry):
5131         * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5132         * fns.c (maybe_resize_hash_table):
5133         * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5134         * gmalloc.c (register_heapinfo):
5135         * image.c (lookup_image_type):
5136         * intervals.c (set_interval_object, set_interval_left)
5137         (set_interval_right, copy_interval_parent, rotate_right)
5138         (rotate_left, balance_possible_root_interval):
5139         * keyboard.c (kset_echo_string, kset_kbd_queue)
5140         (kset_keyboard_translate_table, kset_last_prefix_arg)
5141         (kset_last_repeatable_command, kset_local_function_key_map)
5142         (kset_overriding_terminal_local_map, kset_real_last_command)
5143         (kset_system_key_syms, clear_event, set_prop):
5144         * lread.c (digit_to_number):
5145         * marker.c (attach_marker, live_buffer, set_marker_internal):
5146         * nsterm.m (ns_compute_glyph_string_overhangs):
5147         * process.c (pset_buffer, pset_command)
5148         (pset_decode_coding_system, pset_decoding_buf)
5149         (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5150         (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5151         (pset_status, pset_tty_name, pset_type, pset_write_queue):
5152         * syntax.c (bset_syntax_table, dec_bytepos):
5153         * terminal.c (tset_param_alist):
5154         * textprop.c (interval_has_some_properties)
5155         (interval_has_some_properties_list):
5156         * window.c (wset_combination_limit, wset_dedicated)
5157         (wset_display_table, wset_hchild, wset_left_fringe_width)
5158         (wset_left_margin_cols, wset_new_normal, wset_new_total)
5159         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5160         (wset_right_fringe_width, wset_right_margin_cols)
5161         (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5162         (wset_vertical_scroll_bar_type, wset_window_parameters):
5163         * xdisp.c (wset_base_line_number, wset_base_line_pos)
5164         (wset_column_number_displayed, wset_region_showing)
5165         (window_box_edges, run_window_scroll_functions)
5166         (append_glyph_string_lists, prepend_glyph_string_lists)
5167         (append_glyph_string, set_glyph_string_background_width)
5168         (append_glyph, append_composite_glyph)
5169         (take_vertical_position_into_account):
5170         * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5171         (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5172         (lface_hash, lface_same_font_attributes_p, lookup_face):
5173         * xml.c (libxml2_loaded_p):
5174         * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5175         (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5176         Now 'static', not 'static inline'.
5178         * bidi.c: Tune.
5179         (bidi_copy_it): Do the whole copy with a single memcpy.
5180         (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5182         Revert the FOLLOW-SYMLINKS change for file-attributes.
5183         Doing it right would require several changes to Tramp, and there's
5184         not enough time to get that tested before the freeze today.
5185         * dired.c (directory_files_internal, Ffile_attributes):
5186         Undo last change.
5188         * frame.c (x_report_frame_params): Port better to wider ints.
5189         Do not assume that EMACS_UINT is the same width as uprintmax_t,
5190         or that pointers can be printed in 15 decimal digits.
5191         Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5193 2012-09-30  Fabrice Popineau  <fabrice.popineau@supelec.fr>
5195         Support x64 build on MS-Windows.
5196         * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5197         (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5198         compatibility with x64.
5199         (x_get_focus_frame): Add prototype.
5201         * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5202         defining an XRectangle structure.
5204         * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5205         arithmetics for compatibility with x64.
5207         * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5208         compatibility with x64.
5210         * w32heap.h: Adjust prototypes and declarations.
5212         * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5213         (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5214         DWORD, long, and unsigned long, for compatibility with x64.
5215         (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5216         (sbrk): Argument is now of type ptrdiff_t.
5218         * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5219         less than 0x0500.
5220         (w32_msg_pump): Use WPARAM type for 'result'.
5222         * w32.c (init_environment, get_emacs_configuration): Support AMD64
5223         architecture.
5224         (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5225         compatibility with x64.
5227         * vm-limit.c (lim_data): Now size_t.
5228         (check_memory_limits): Adjust prototypes of real_morecore and
5229         __morecore to receive argument of type ptrdiff_t.  Use size_t for
5230         five_percent and data_size.
5232         * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5233         variables, for compatibility with x64.
5234         (rva_to_section, offset_to_section, relocate_offset)
5235         (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5236         (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5237         (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5238         for compatibility with x64.
5240         * sysdep.c (STDERR_FILENO): Define if not already defined.
5242         * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5243         (__morecore): Argument type is now ptrdiff_t.
5244         (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5245         (relinquish): Use ptrdiff_t type for 'excess'.
5246         (r_alloc_sbrk): Argument type is now ptrdiff_t.
5248         * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5249         (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5250         instead of a literal number.
5252         * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5253         (min): Define only if not already defined.
5255         * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5256         value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5257         hosts.
5259         * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5260         'bitmaps' is a pointer.
5262         * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5264         * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5266 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
5268         file-attributes has a new optional arg FOLLOW-SYMLINKS.
5269         * dired.c (directory_files_internal, Ffile_attributes):
5270         New arg follow_symlinks.  All uses changed.
5272 2012-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
5274         * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5276 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
5278         Support atimers and CPU profiler via profile.c on MS-Windows.
5279         * w32proc.c (sig_mask, crit_sig): New static variables.
5280         (sys_signal): Support SIGALRM and SIGPROF.
5281         (sigemptyset, sigaddset, sigfillset, sigprocmask)
5282         (pthread_sigmask, setpgrp): Move here from w32.c.  sigaddset,
5283         sigfillset, and sigprocmask are no longer no-ops.
5284         (sigismember): New function.
5285         (struct itimer_data): New definition.
5286         (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5287         (crit_prof): New static variables.
5288         (MAX_SINGLE_SLEEP): New definition.
5289         (timer_loop, stop_timer_thread, term_timers, init_timers)
5290         (start_timer_thread, getitimer, setitimer): New functions.
5291         (alarm): No longer a no-op, calls setitimer.
5293         * w32.c (term_ntproc): Call term_timers.
5294         (init_ntproc): Make sure all signals are unblocked at startup, to
5295         erase any traces of dumping.  Call init_timers.
5297         * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5298         Windows-specific code to display the hourglass mouse pointer is no
5299         longer used.
5300         (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5301         to hourglass timer expiration.
5302         (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5303         Remove, no longer used.
5304         (w32_note_current_window, show_hourglass, hide_hourglass):
5305         New functions, in support of hourglass cursor display similar to other
5306         window systems.
5307         (syms_of_w32fns): Don't initialize hourglass_timer.
5309         * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5310         WINDOWSNT as well.
5311         (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5313         * w32.h (init_timers, term_timers): Add prototypes.
5315 2012-09-30  Kenichi Handa  <handa@gnu.org>
5317         * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5318         to the buffer relocation which may be caused by ccl_driver.
5320 2012-09-30  Jan Djärv  <jan.h.d@swipnet.se>
5322         * xfns.c (Fx_file_dialog): Update comment.
5324         * w32fns.c (Fx_file_dialog): Update comment.
5326         * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5327         Initialize panel name field if OSX >= 10.6.
5329         * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5331         * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5333         * nsterm.m (NEW_STYLE_FS): New define.
5334         (ns_fullscreen_hook, windowWillEnterFullScreen)
5335         (windowDidEnterFullScreen, windowWillExitFullScreen)
5336         (windowDidExitFullScreen, toggleFullScreen, handleFS)
5337         (setFSValue): New functions.
5338         (EmacsFSWindow): New implementation.
5339         (canBecomeKeyWindow): New function for EmacsFSWindow.
5340         (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5341         (dealloc): Release nonfs_window if in fullscreen.
5342         (updateFrameSize:): Call windowDidMove to update top/left.
5343         (windowWillResize:toSize:): Check if frame is still maximized.
5344         (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5345         next_maximized, maximized_width, maximized_height and nonfs_window.
5346         Call setCollectionBehavior if NEW_STYLE_FS.  Initialize bwidth and
5347         tbar_height.
5348         (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
5349         fullscreen.  Set maximized_width/height.  Act on next_maximized.
5351         * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5352         (EmacsView): Add variables for fullscreen.
5353         (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5354         (EmacsFSWindow): New interface for fullscreen.
5356 2012-09-30  Juanma Barranquero  <lekktu@gmail.com>
5358         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5360 2012-09-30  Chong Yidong  <cyd@gnu.org>
5362         * fns.c (Frandom): Doc fix.
5364 2012-09-30  Martin Rudalics  <rudalics@gmx.at>
5366         * window.c (Vwindow_combination_limit): New default value.
5367         (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5369 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
5371         * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5372         Suggested by Eli Zaretskii in
5373         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5375 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
5377         * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5378         HAVE_TIMER_SETTIME is defined.
5380 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
5382         Profiler improvements: more-accurate timers, overflow checks.
5383         * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5384         signal.h, setjmp.h.  Include systime.h instead.
5385         (saturated_add): New function.
5386         (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5387         (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5388         (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5389         New static vars.
5390         (enum profiler_cpu_running): New enum.
5391         (profiler_cpu_running): Now of that enum type, not bool.
5392         All uses changed to store the new value.
5393         (handle_profiler_signal): Rename from sigprof_handler_1,
5394         for consistency with other handlers.  Do not check whether
5395         cpu_log is a hash-table if garbage collecting, since it
5396         doesn't matter in that case.
5397         (deliver_profiler_signal): Rename from sigprof_handler,
5398         for consistency with other handlers.
5399         (setup_cpu_timer): New function, with much of what used to be in
5400         Fprofiler_cpu_start.  Check for out-of-range argument.
5401         Prefer timer_settime if available, and prefer
5402         thread cputime clocks, then process cputime clocks, then
5403         monotonic clocks, to the old realtime clock.  Use make_timeval
5404         to round more-correctly when falling back to setitimer.
5405         (Fprofiler_cpu_start): Use it.
5406         (Fprofiler_cpu_stop): Prefer timer_settime if available.
5407         Don't assume that passing NULL as the 2nd argument of setitimer
5408         is the same as passing a pointer to all-zero storage.
5409         Ignore SIGPROF afterwards.
5410         (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5411         * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5412         non-fatal signal handlers.  Ignore SIGPROF on startup.
5413         * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5414         in profiler.c, since sysdep.c now uses it.
5416         * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5417         Suggested by Eli Zaretskii in
5418         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5420 2012-09-29  Juanma Barranquero  <lekktu@gmail.com>
5422         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5424 2012-09-29  Stefan Monnier  <monnier@iro.umontreal.ca>
5426         * lisp.h (struct backtrace): Remove indirection for `function' field.
5427         * xdisp.c (redisplay_internal):
5428         * profiler.c (record_backtrace, sigprof_handler_1):
5429         * alloc.c (Fgarbage_collect):
5430         * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5431         (Fbacktrace_frame): Adjust accordingly.
5433 2012-09-28  Glenn Morris  <rgm@gnu.org>
5435         * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5436         (Frun_hook_with_args_until_failure): Doc fixes.
5438 2012-09-28  Eli Zaretskii  <eliz@gnu.org>
5440         * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5441         Qautomatic_redisplay and change the symbol name.  All users changed.
5443 2012-09-28  Tomohiro Matsuyama  <tomo@cx4a.org>
5445         * profiler.c (sigprof_handler): Fix race condition.
5447 2012-09-28  Glenn Morris  <rgm@gnu.org>
5449         * lread.c (lisp_file_lexically_bound_p): Handle #! lines.  (Bug#12528)
5451 2012-09-27  Paul Eggert  <eggert@cs.ucla.edu>
5453         Check more robustly for timer_settime.
5454         * Makefile.in (LIB_TIMER_TIME): New macro.
5455         (LIBES): Add it.
5456         * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5457         Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5458         call timer_settime.
5460 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
5462         * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5464 2012-09-26  Juanma Barranquero  <lekktu@gmail.com>
5466         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5468 2012-09-26  Paul Eggert  <eggert@cs.ucla.edu>
5470         * character.h (MAYBE_UNIFY_CHAR): Remove.
5471         * charset.c, charset.h (maybe_unify_char): Now static.
5472         * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5473         Since this stuff is now private to charset.c, there's no need for
5474         a public macro and no need to inline by hand.
5476 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
5477             Stefan Monnier  <monnier@iro.umontreal.ca>
5478             Juanma Barranquero  <lekktu@gmail.com>
5480         * profiler.c: New file.
5481         * Makefile.in (base_obj): Add profiler.o.
5482         * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5483         ($(BLD)/profiler.$(O)): New target.
5484         * emacs.c (main): Call syms_of_profiler.
5485         * alloc.c (Qautomatic_gc): New constant.
5486         (MALLOC_PROBE): New macro.
5487         (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5488         (total_bytes_of_live_objects): New function.
5489         (Fgarbage_collect): Use it.  Record itself in backtrace_list.
5490         Call malloc_probe for the memory profiler.
5491         (syms_of_alloc): Define Qautomatic_gc.
5492         * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5493         race condition.
5494         (struct backtrace): Move definition...
5495         * lisp.h (struct backtrace): ..here.
5496         (Qautomatic_gc, profiler_memory_running): Declare vars.
5497         (malloc_probe, syms_of_profiler): Declare functions.
5498         * xdisp.c (Qautomatic_redisplay): New constant.
5499         (redisplay_internal): Record itself in backtrace_list.
5500         (syms_of_xdisp): Define Qautomatic_redisplay.
5502 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
5503 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
5505         * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5507 2012-09-25  Paul Eggert  <eggert@cs.ucla.edu>
5509         Prefer POSIX timers if available.
5510         They avoid a race if the timer is too close to the current time.
5511         * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5512         (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
5513         (init_atimer) [SIGEV_SIGNAL]: Initialize them.
5515 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
5517         * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5518         CHAR_STRING_ADVANCE.
5519         (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5520         STRING_CHAR_ADVANCE.
5522 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
5524         Move Vlibrary_cache to emacs.c and reset before dumping.
5526         * lisp.h (reset_image_types): Declare.
5527         [WINDOWSNT] (Vlibrary_cache): Declare.
5529         * image.c (reset_image_types): New function.
5531         * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5532         (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5533         (Fdump_emacs): Reset Vlibrary_cache and image_types.
5535         * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5536         (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5538         * w32.h (Vlibrary_cache): Do not declare.
5540 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
5542         * w32proc.c (sys_signal): Handle all signals defined by the
5543         MS-Windows runtime, not just SIGCHLD.  Actually install the signal
5544         handlers for signals supported by Windows.  Don't override
5545         term_ntproc as the handler for SIGABRT.
5546         (sigaction): Rewrite to call sys_signal instead of duplicating its
5547         code.
5548         (sys_kill): Improve commentary.
5550         * w32.c (term_ntproc): Accept (and ignore) one argument, for
5551         consistency with a signature of a signal handler.  All callers
5552         changed.
5553         (init_ntproc): Accept an argument DUMPING.  If dumping, don't
5554         install term_ntproc as a signal handler for SIGABRT, as that
5555         should be done by the dumped Emacs.
5557         * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5559         * w32select.c (term_w32select): Protect against repeated
5560         invocation by setting clipboard_owner to NULL after calling
5561         DestroyWindow.
5563         * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5564         and term_ntproc to their modified signatures.
5566         * character.c (char_string, string_char): Remove calls to
5567         MAYBE_UNIFY_CHAR.  See the discussion starting at
5568         http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5569         for the details.
5571 2012-09-25  Chong Yidong  <cyd@gnu.org>
5573         * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5575 2012-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>
5577         * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5578         when encountering an unknown bytecode.
5580 2012-09-24  Paul Eggert  <eggert@cs.ucla.edu>
5582         image.c, indent.c: Use bool for booleans.
5583         * dispextern.h (struct image_type): Members valid_p, load, init
5584         now return bool, not int.  All uses changed.
5585         * image.c: Omit unnecessary static decls.
5586         (x_create_bitmap_mask, x_build_heuristic_mask):
5587         Return void, not int, since callers don't care about the return value.
5588         (x_create_bitmap_mask, define_image_type, valid_image_p)
5589         (struct image_keyword, parse_image_spec, image_spec_value)
5590         (check_image_size, image_background)
5591         (image_background_transparent, x_clear_image_1)
5592         (postprocess_image, lookup_image, x_check_image_size)
5593         (x_create_x_image_and_pixmap, xbm_image_p)
5594         (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5595         (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5596         (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5597         (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5598         (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5599         (png_image_p, init_png_functions, png_load_body, png_load)
5600         (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5601         (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5602         (init_gif_functions, gif_load, imagemagick_image_p)
5603         (imagemagick_load_image, imagemagick_load, svg_image_p)
5604         (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5605         (gs_load):
5606         * nsimage.m (ns_load_image):
5607         * nsterm.m (ns_defined_color):
5608         * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5609         * xfns.c (x_defined_color):
5610         * xterm.c (x_alloc_lighter_color_for_widget)
5611         (x_alloc_nearest_color_1, x_alloc_nearest_color)
5612         (x_alloc_lighter_color):
5613         * indent.c (disptab_matches_widthtab, current_column)
5614         (scan_for_column, string_display_width, indented_beyond_p)
5615         (compute_motion, vmotion, Fvertical_motion):
5616         Use bool for booleans.
5618 2012-09-24  Chong Yidong  <cyd@gnu.org>
5620         * chartab.c (Fset_char_table_default): Obsolete function removed.
5622 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
5624         Move pid_t related decls out of lisp.h.
5625         * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5626         (interruptible_wait_for_termination):
5627         Move these decls from lisp.h to syswait.h, since they use pid_t.
5628         Needed on FreeBSD; see Herbert J. Skuhra in
5629         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5630         * callproc.c: Include syswait.h.
5632         gnutls.c, gtkutil.c: Use bool for boolean.
5633         * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5634         (emacs_gnutls_handle_error):
5635         * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5636         (xg_hide_tooltip, xg_create_frame_widgets)
5637         (create_dialog, xg_uses_old_file_dialog)
5638         (xg_get_file_with_chooser, xg_get_file_with_selection)
5639         (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5640         (xg_item_label_same_p, xg_update_menubar)
5641         (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5642         (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5643         (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5644         (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5645         (update_frame_tool_bar, free_frame_tool_bar):
5646         * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5647         * nsmenu.m (ns_update_menubar):
5648         * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5649         * xfns.c (Fx_show_tip) [USE_GTK]:
5650         Use bool for boolean.
5651         * gtkutil.c (xg_update_frame_menubar):
5652         * xmenu.c (update_frame_menubar):
5653         Return void, not int, since caller ignores return value.
5654         * gtkutil.c (xg_change_toolbar_position):
5655         Return void, not 1.
5657 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
5659         * makefile.w32-in (BLOCKINPUT_H): Remove.
5660         (SYSSIGNAL_H): New macro.
5661         ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5662         ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5663         ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5664         ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5665         ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5666         ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5667         ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5668         ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5669         ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5670         ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5671         ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5672         ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5673         ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5674         ($(BLD)/w32xfns.$(O)): Update dependencies.
5676 2012-09-23  Eli Zaretskii  <eliz@gnu.org>
5678         * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5679         fatal_error_backtrace.
5681         * w32proc.c (sys_kill): Undo last change: don't do anything when
5682         invoked to deliver SIGABRT to our own process.  This is now
5683         handled by emacs_raise.
5685 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
5687         * w32term.c (w32_read_socket): Remove leftover reference to
5688         interrupt_input_pending.
5690 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
5692         Do not use SA_NODEFER.
5693         Problem reported by Dani Moncayo in
5694         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5695         * alloc.c (die):
5696         * sysdep.c (emacs_abort): Do not reset signal handler.
5697         * emacs.c (terminate_due_to_signal): Reset signal handler here.
5698         * sysdep.c (init_signals): Do not use SA_NODEFER.  It wasn't
5699         wanted even on POSIXish hosts, and it doesn't work on Windows.
5701 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
5703         * xterm.c (x_term_init): Call fixup_locale before and after calling
5704         gtk_init (Bug#12392).
5706 2012-09-23  Chong Yidong  <cyd@gnu.org>
5708         * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5709         Vdynamic_library_alist.
5711         * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5712         (Fgnutls_available_p): Caller changed.
5714         * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5715         (Flibxml_parse_xml_region): Likewise.
5717         * dispextern.h (struct image_type): Remove arg from init function.
5719         * image.c (Finit_image_library, lookup_image_type)
5720         (define_image_type): Remove now-unneeded second arg.
5721         (init_xpm_functions, init_png_functions, init_jpeg_functions)
5722         (init_tiff_functions, init_gif_functions, init_svg_functions):
5723         Arglist and w32_delayed_load calling convention changed.
5724         (gs_type): Remove init_gs_functions; there is no such function.
5725         (valid_image_p, make_image): Fix caller to lookup_image_type.
5727 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
5729         Simplify and avoid signal-handling races (Bug#12471).
5730         * alloc.c (die):
5731         * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5732         Avoid recursive loop if there's a fatal error in the function itself.
5733         * atimer.c (pending_atimers):
5734         * blockinput.h: Don't include "atimer.h"; no longer needed.
5735         (interrupt_input_pending): Remove.  All uses removed.
5736         pending_signals now counts both atimers and ordinary interrupts.
5737         This is less racy than having three separate pending-signal flags.
5738         (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5739         (input_blocked_p):
5740         Rename from their upper-case counterparts BLOCK_INPUT,
5741         UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5742         INPUT_BLOCKED_P, and turn into functions.  All uses changed.
5743         This makes it easier to access volatile variables more accurately.
5744         (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
5745         (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5746         that's more reliable if the code is buggy and sets
5747         interrupt_input_blocked to a negative value.  All uses changed.
5748         * atimer.c (deliver_alarm_signal):
5749         Remove.  No need to deliver this to the parent; any thread can
5750         handle this signal now.  All uses replaced by underlying handler.
5751         * atimer.c (turn_on_atimers):
5752         * dispnew.c (handle_window_change_signal):
5753         * emacs.c (handle_danger_signal):
5754         * keyboard.c (kbd_buffer_get_event):
5755         Don't reestablish signal handler; not needed with sigaction.
5756         * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5757         (UNBLOCK_INPUT_TO):
5758         Rework to avoid unnecessary accesses to volatile variables.
5759         (UNBLOCK_INPUT_TO): Now a function.
5760         (totally_unblock_input, unblock_input): New decls.
5761         * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5762         (init_data): Remove.  Necessary stuff now done in init_signal.
5763         * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5764         * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5765         (fatal_error_code): Remove; no longer needed.
5766         (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5767         it doesn't always backtrace.  All uses changed.  No need to reset
5768         signal to default, since sigaction and/or die does that for us now.
5769         Use emacs_raise (FOO), not kill (getpid (), FOO).
5770         (main): Check more-accurately whether we're dumping.
5771         Move fatal-error setup to sysdep.c
5772         * floatfns.c: Do not include "syssignal.h"; no longer needed.
5773         * gtkutil.c (xg_get_file_name, xg_get_font):
5774         Remove no-longer-needed signal-mask manipulation.
5775         * keyboard.c, process.c (POLL_FOR_INPUT):
5776         Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5777         * keyboard.c (read_avail_input): Remove.
5778         All uses replaced by gobble_input.
5779         (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5780         (kbd_buffer_store_event_hold, gobble_input):
5781         (record_asynch_buffer_change) [USABLE_SIGIO]:
5782         (store_user_signal_events):
5783         No need to mess with signal mask.
5784         (gobble_input): If blocking input and there are terminals, simply
5785         set pending_signals to 1 and return.  All hooks changed to not
5786         worry about whether input is blocked.
5787         (process_pending_signals): Clear pending_signals before processing
5788         them, in case a signal comes in while we're processing.
5789         By convention callers now test pending_signals before calling us.
5790         (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5791         New functions, to support changes to blockinput.h.
5792         (handle_input_available_signal): Now extern.
5793         (reinvoke_input_signal): Remove.  All uses replaced by
5794         handle_async_input.
5795         (quit_count): Now volatile, since a signal handler uses it.
5796         (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5797         All callers changed.  Block SIGINT only if not already blocked.
5798         Clear sigmask reliably, even if Fsignal returns, which it can.
5799         Omit unnecessary accesses to volatile var.
5800         (quit_throw_to_read_char): No need to restore sigmask.
5801         * keyboard.c (gobble_input, handle_user_signal):
5802         * process.c (wait_reading_process_output):
5803         Call signal-handling code rather than killing ourselves.
5804         * lisp.h: Include <float.h>, for...
5805         (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5806         (pending_signals): Now volatile.
5807         (syms_of_data): Now const if IEEE floating point.
5808         (handle_input_available_signal) [USABLE_SIGIO]:
5809         (terminate_due_to_signal, record_child_status_change): New decls.
5810         * process.c (create_process): Avoid disaster if memory is exhausted
5811         while we're processing a vfork, by tightening the critical section
5812         around the vfork.
5813         (send_process_frame, process_sent_to, handle_pipe_signal)
5814         (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
5815         ignores SIGPIPE.
5816         (send_process): No need for setjmp/longjmp any more, since the
5817         SIGPIPE stuff is now gone.  Instead, report an error if errno
5818         is EPIPE.
5819         (record_child_status_change): Now extern.  PID and W are now args.
5820         Return void, not bool.  All callers changed.
5821         * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5822         Remove.  All uses removed.  This bug should be fixed now in a
5823         different way.
5824         (wait_for_termination_1): Use waitpid rather than sigsuspend,
5825         and record the child status change directly.  This avoids the
5826         need to futz with the signal mask.
5827         (process_fatal_action): Move here from emacs.c.
5828         (emacs_sigaction_flags): New function, containing
5829         much of what used to be in emacs_sigaction_init.
5830         (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
5831         caught by emacs, to make races less likely.
5832         (deliver_process_signal): Rename from handle_on_main_thread.
5833         All uses changed.
5834         (BACKTRACE_LIMIT_MAX): Now at top level.
5835         (thread_backtrace_buffer, threadback_backtrace_pointers):
5836         New static vars.
5837         (deliver_thread_signal, deliver_fatal_thread_signal):
5838         New functions, for more-accurate delivery of thread-specific signals.
5839         (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5840         (deliver_arith_signal): Handle in this thread, not
5841         in the main thread, since it's triggered by this thread.
5842         (maybe_fatal_sig): New function.
5843         (init_signals): New arg DUMPING so that we can be more accurate
5844         about whether we're dumping.  Caller changed.
5845         Treat thread-specific signals differently from process-general signals.
5846         Block all signals while handling fatal error; that's safer.
5847         xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5848         on IEEE hosts.
5849         When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5850         Ignore SIGPIPE unless batch.
5851         (emacs_backtrace): Output backtrace for the appropriate thread,
5852         which is not necessarily the main thread.
5853         * syssignal.h: Include <stdbool.h>.
5854         (emacs_raise): New macro.
5855         * xterm.c (x_connection_signal): Remove; no longer needed
5856         now that we use sigaction.
5857         (x_connection_closed): No need to mess with sigmask now.
5858         (x_initialize): No need to reset SIGPIPE handler here, since
5859         init_signals does this for us now.
5861 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
5863         * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
5864         background rect may be larger (Bug#12245).
5866 2012-09-23  Chong Yidong  <cyd@gnu.org>
5868         * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5870 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
5872         * .gdbinit: Just stop at fatal_error_backtrace.
5873         See Stefan Monnier's request in
5874         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5875         Remove no-longer-used query of system type.
5877 2012-09-22  Chong Yidong  <cyd@gnu.org>
5879         * search.c (Freplace_match): Doc fix (Bug#12325).
5881         * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5883         * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5884         (Fline_end_position): Doc fix.
5886         * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5888 2012-09-22  Chong Yidong  <cyd@gnu.org>
5890         * dispextern.h (struct image_type): Add new slot, storing a type
5891         initialization function.
5893         * image.c (define_image_type): Call the image initializer function
5894         if it is defined.  Arguments and return value changed.
5895         (valid_image_p, make_image): Callers changed.
5896         (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
5897         (gif_type, imagemagick_type, svg_type, gs_type):
5898         Add initialization functions.
5899         (Finit_image_library): Call lookup_image_type.
5900         (CHECK_LIB_AVAILABLE): Macro deleted.
5901         (lookup_image_type): Call define_image_type here, rather than via
5902         Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5903         (syms_of_image): Move define_image_type calls for xbm_type and
5904         pbm_type to lookup_image_type.
5906 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
5908         * keyboard.c (timer_check_2): Move calculation of 'timers' and
5909         'idle_timers' from here ...
5910         (timer_check): ... to here.  Use Fcopy_sequence to copy the timer
5911         lists, to avoid infloops when the timer does something stupid,
5912         like reinvoke itself with the same or smaller time-out.
5913         (Bug#12447)
5915 2012-09-22  Martin Rudalics  <rudalics@gmx.at>
5917         * window.c (Fsplit_window_internal): Handle only Qt value of
5918         Vwindow_combination_limit separately.
5919         (Qtemp_buffer_resize): New symbol.
5920         (Vwindow_combination_limit): New default value.
5921         Rewrite doc-string.
5923 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
5925         * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5926         the new overlay string.  (Bug#10159)
5928 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
5930         * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5931         or that fprintf is async-signal-safe.  POSIX doesn't require
5932         either assumption.
5934 2012-09-22  Chong Yidong  <cyd@gnu.org>
5936         * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5937         (Bug#8207).
5939 2012-09-22  Kenichi Handa  <handa@gnu.org>
5941         * composite.c (composition_reseat_it): Handle the case that a
5942         grapheme cluster is not covered by a single font (Bug#12352).
5944 2012-09-21  Chong Yidong  <cyd@gnu.org>
5946         * image.c (define_image_type): Avoid adding duplicate types to
5947         image_types (Bug#12463).  Suggested by Jörg Walter.
5949 2012-09-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
5951         * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5952         (print_load_command_name): Add case LC_DATA_IN_CODE.
5953         (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5955 2012-09-21  Glenn Morris  <rgm@gnu.org>
5957         * eval.c (Frun_hook_with_args_until_success)
5958         (Frun_hook_with_args_until_failure): Doc fixes.  (Bug#12393)
5960 2012-09-21  Andreas Schwab  <schwab@linux-m68k.org>
5962         * fileio.c (Ffile_selinux_context): Only call freecon when
5963         lgetfilecon succeeded.
5964         (Fset_file_selinux_context): Likewise.  (Bug#12444)
5966 2012-09-21  Eli Zaretskii  <eliz@gnu.org>
5968         * xdisp.c (try_window_reusing_current_matrix): Under bidi
5969         reordering, locate the cursor by calling set_cursor_from_row; if
5970         that fails, clear the desired glyph matrix before returning a
5971         failure indication to the caller.  Fixes leaving garbled display
5972         when fast scrolling with a down-key.  (Bug#12403)
5973         (compute_stop_pos_backwards): Fix a typo that caused crashes while
5974         scrolling through multibyte text.
5976 2012-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
5978         * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5979         calling mark_vectorlike since that's the one that marks the window.
5980         (mark_discard_killed_buffers): Mark the final cdr.
5981         * window.h (struct window): Move prev/next_buffers to the
5982         non-standard fields.
5983         * window.c (make_window): Initialize prev/next_buffers manually.
5985 2012-09-20  Paul Eggert  <eggert@cs.ucla.edu>
5987         Omit unused arg EXPECTED from socket hooks.
5988         * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5989         * nsterm.m (ns_term_init):
5990         * termhooks.h (struct terminal.read_socket_hook):
5991         * w32inevt.c (w32_console_read_socket):
5992         * w32term.c (w32_read_socket):
5993         * xterm.c (XTread_socket):
5994         Omit unused arg EXPECTED.  All callers changed.
5995         (store_user_signal_events): Return void, not int, since callers no
5996         longer care about the return value.  All uses changed.
5998 2012-09-20  Juanma Barranquero  <lekktu@gmail.com>
6000         * w32gui.h (XParseGeometry): Do not declare.
6002 2012-09-19  Paul Eggert  <eggert@cs.ucla.edu>
6004         * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
6005         Ignore 'expected'.  See Eli Zaretskii in
6006         <http://bugs.gnu.org/12471#8> (last line).
6008         * frame.c (read_integer): Remove.  All uses replaced by strtol/strtoul.
6009         (XParseGeometry): Now static.  Substitute extremal values for
6010         values that are out of range.
6012 2012-09-19  Jan Djärv  <jan.h.d@swipnet.se>
6014         * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6016         * nsfns.m (XParseGeometry): Remove.
6017         (Fx_create_frame): Call x_set_offset to correctly interpret
6018         top_pos in geometry.
6020         * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
6021         (Fx_parse_geometry): If there is a space in string, call
6022         Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6024 2012-09-17  Eli Zaretskii  <eliz@gnu.org>
6026         * search.c (scan_buffer): Use character positions in calls to
6027         region_cache_forward and region_cache_backward, not byte
6028         positions.  (Bug#12196)
6030         * w32term.c (w32_read_socket): Set pending_signals to 1, like
6031         xterm.c does.  Reported by Daniel Colascione <dancol@dancol.org>.
6033         * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6034         __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6035         emacs_blocked_malloc, now deleted.
6037 2012-09-17  Paul Eggert  <eggert@cs.ucla.edu>
6039         Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6040         The workaround was for improving performance on Solaris 2.4, but
6041         is getting in the way now.  Emacs will still work if someone is
6042         still running Solaris 2.4 in a museum somewhere; Sun dropped
6043         support for Solaris 2.4 in 2003.
6044         * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6045         * process.c (create_process) [HAVE_WORKING_VFORK]:
6046         Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6047         since Emacs no longer uses vfork on that platform.
6049 2012-09-17  Glenn Morris  <rgm@gnu.org>
6051         * emacs.c: Use COPYRIGHT.
6053 2012-09-16  Paul Eggert  <eggert@cs.ucla.edu>
6055         Remove configure's --without-sync-input option (Bug#12450).
6056         When auditing signal-handling in preparation for cleaning it up,
6057         I found that SYNC_INPUT has race conditions and would be a real
6058         pain to fix.  Since it's an undocumented and deprecated
6059         configure-time option, now seems like a good time to remove it.
6060         Also see <http://bugs.gnu.org/11080#16>.
6061         * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6062         (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6063         (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6064         (malloc_hysteresis):
6065         (check_depth) [XMALLOC_OVERRUN_CHECK]:
6066         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6067         (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6068         (dont_register_blocks, bytes_used_when_reconsidered)
6069         (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6070         (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6071         [!SYSTEM_MALLOC && !SYNC_INPUT]:
6072         Remove.  All uses removed.
6073         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6074         implementation, one that depends on whether the new macro
6075         XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6076         is defined.
6077         * atimer.c (run_timers, handle_alarm_signal):
6078         * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6079         (handle_async_input, process_pending_signals)
6080         (handle_input_available_signal, init_keyboard):
6081         * nsterm.m (ns_read_socket):
6082         * process.c (wait_reading_process_output):
6083         * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6084         * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6085         (emacs_write):
6086         * xterm.c (XTread_socket):
6087         Assume SYNC_INPUT.
6088         * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6089         * eval.c (handling_signal): Remove.  All uses removed.
6090         * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6091         All uses replaced with the SYNC_INPUT version.
6092         (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6093         Remove decls.
6094         * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6095         Now static.
6097         * font.c (Ffont_shape_gstring): Remove unused local.
6099 2012-09-16  Glenn Morris  <rgm@gnu.org>
6101         * Makefile.in (clean): No longer run nextstep's clean.
6103         * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6104         (ns_frag): Remove.
6105         (ns-app): Move here from ns.mk, and simplify.
6106         (clean): Simplify nextstep entry.
6107         * ns.mk: Remove file.
6109 2012-09-17  Kenichi Handa  <handa@gnu.org>
6111         * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6112         not covert the last few charactes.
6114 2012-09-16  Kenichi Handa  <handa@gnu.org>
6116         * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6117         here, but just check the validity of glyphs in the glyph-string.
6119 2012-09-16  Martin Rudalics  <rudalics@gmx.at>
6121         * window.c (Fwindow_parameter, Fset_window_parameter):
6122         Accept any window as argument (Bug#12452).
6124 2012-09-16  Jan Djärv  <jan.h.d@swipnet.se>
6126         * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6127         to ns_term_init to avoid memory leak.
6129         * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6130         explicit retain/release.
6131         (ns_term_init): Only allow one display.  Initialize outerpool and
6132         ns_*_types.
6134 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
6136         Port _setjmp fix to POSIXish hosts as well as Microsoft.
6137         * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6138         it's needed on POSIXish hosts that lack _setjmp.  Attempt to solve
6139         the Microsoft problem in a different way, by altering ../nt/config.nt.
6141 2012-09-15  Eli Zaretskii  <eliz@gnu.org>
6143         * w32xfns.c:
6144         * w32uniscribe.c:
6145         * w32term.c:
6146         * w32select.c:
6147         * w32reg.c:
6148         * w32proc.c:
6149         * w32menu.c:
6150         * w32inevt.c:
6151         * w32heap.c:
6152         * w32font.c:
6153         * w32fns.c:
6154         * w32console.c:
6155         * w32.c:
6156         * w16select.c: Remove inclusion of setjmp.h, as it is now included
6157         by lisp.h.  This completes removal of setjmp.h inclusion
6158         erroneously announced in the previous commit.  (Bug#12446)
6160         * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6161         more accurate.
6163         * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6164         not defined as a macro.  The latter happens on MS-Windows.
6165         (Bug#12446)
6167 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
6169         Port better to POSIX hosts lacking _setjmp (Bug#12446).
6170         * lisp.h: Include <setjmp.h> here, since we use its symbols here.
6171         Some instances of '#include <setjmp.h>' removed, if the
6172         only reason for the instance was because "lisp.h" was included.
6173         (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6174         Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6175         and _longjmp with the new symbols.  Emacs already uses _setjmp if
6176         available, so this change affects only POSIXish hosts that have
6177         sigsetjmp but not _setjmp, such as some versions of Solaris and
6178         Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
6179         * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6180         (png_load_body) [HAVE_PNG]:
6181         (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6182         (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6183         Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6184         since PNG requires jmp_buf.  This is the only exception to the
6185         general rule that we now use sys_setjmp and sys_longjmp.
6186         This exception is OK since this code does not change the signal
6187         mask or longjmp out of a signal handler.
6189 2012-09-14  Paul Eggert  <eggert@cs.ucla.edu>
6191         * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6192         Include "syssignal.h", for 'main_thread'.
6194 2012-09-14  Dmitry Antipov  <dmantipov@yandex.ru>
6196         Avoid out-of-range marker position (Bug#12426).
6197         * insdel.c (replace_range, replace_range_2):
6198         Adjust markers before overlays, as suggested by comments.
6199         (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6200         Remove redundant check before calling offset_intervals.
6202 2012-09-14  Martin Rudalics  <rudalics@gmx.at>
6204         * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6205         current buffer (Bug#12387).
6207 2012-09-14  Juanma Barranquero  <lekktu@gmail.com>
6209         * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6211 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
6213         Use a more backwards-compatible timer format (Bug#12430).
6214         * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6215         vector element, not from the 4th, since PSECS is now at the end.
6216         (Fcurrent_idle_time): Doc fix.
6218 2012-09-13  Dmitry Antipov  <dmantipov@yandex.ru>
6220         Function to mark objects and remove killed buffers at once.
6221         * alloc.c (discard_killed_buffers): Rename to ...
6222         (mark_discard_killed buffers) ... new name.  Add marking
6223         of remaining objects.  Fix comment.  Adjust users.
6224         (mark_object): Do not touch frame buffer lists here.
6225         * frame.c (delete_frame): Reset frame buffer lists here.
6227 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
6229         Better workaround for GNOME bug when --enable-gcc-warnings.
6230         * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6231         Instead, disable -Wunused-local-typedefs.  See Dmitry Antipov in
6232         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6234         Simplify SIGIO usage (Bug#12408).
6235         The code that dealt with SIGIO was crufty and confusing, e.g., it
6236         played tricks like "#undef SIGIO" but these tricks were not used
6237         consistently.  Simplify mostly by not #undeffing standard symbols,
6238         e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6239         or not as we please) rather than "defined SIGIO" (standard symbol
6240         that we probably shouldn't #undef).
6241         * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6242         Modules that need it can include it.
6243         [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6244         * dispextern.h (ignore_sigio): New decl.
6245         * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6246         unconditionally, since it's now a no-op if !USABLE_SIGIO.
6247         * emacs.c (shut_down_emacs):
6248         * keyboard.c (kbd_buffer_store_event_hold):
6249         Use ignore_sigio rather than invoking 'signal' directly.
6250         * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6251         for FIONREAD.
6252         (FIONREAD, SIGIO): Do not #undef.
6253         (tty_read_avail_input): Use #error rather than a syntax error.
6254         * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6255         for I_PIPE, used by SETUP_SLAVE_PTY.
6256         (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6257         * sysdep.c (croak): Remove; no longer needed.  This bit of
6258         temporary code, with Fred N. Fish's comment that it's temporary,
6259         has been in Emacs since at least 1992!
6260         (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6261         Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6262         * syssignal.h (croak): Remove decl.
6263         (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6264         * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6265         now that we're termios-only.
6266         (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6267         * term.c (dissociate_if_controlling_tty): Use #error rather than
6268         a run-time error.
6270         Work around GCC and GNOME bugs when --enable-gcc-warnings.
6271         * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6272         to work around GNOME bug 683906.
6273         * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6274         (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6275         This works around GCC bug 54561.
6277 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
6279         More fixes for 'volatile' and setjmp/longjmp.
6280         * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6281         * image.c (struct png_load_context) [HAVE_PNG]: New type.
6282         (png_load_body) [HAVE_PNG]:
6283         (jpeg_load_body) [HAVE_JPEG]:
6284         New function, with most of the old parent function's body.
6285         (png_load) [HAVE_PNG]:
6286         (jpeg_load) [HAVE_JPEG]:
6287         Invoke the new function, to avoid longjmp munging our locals.
6288         (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6289         (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6290         longjmp is passed 2, as the C standard doesn't guarantee this.
6291         Instead, store the failure code into mgr->failure_code.
6293 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
6295         * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6296         (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6297         (syms_of_keyboard): Remove support for unread-command-char.
6299 2012-09-12  Eli Zaretskii  <eliz@gnu.org>
6301         * w32proc.c (sys_kill): If PID is our process ID and the signal is
6302         SIGABRT, call emacs_abort.  Avoids silently exiting upon assertion
6303         violation.  (Bug#12426)
6305 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
6307         * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6309 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
6311         * eval.c: Add `inhibit-debugger'.
6312         (Qinhibit_debugger): New symbol.
6313         (call_debugger): Bind it instead of Qdebug_on_error.
6314         (maybe_call_debugger): Test Vinhibit_debugger.
6315         (syms_of_eval): Define inhibit-debugger.
6316         * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6317         (syms_of_xdisp): Remove inhibit-debug-on-message.
6319 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
6321         Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6322         If a nonvolatile local variable is written before a _longjmp to
6323         the frame containing the variable, and is read after the _longjmp,
6324         the value read is indeterminate.  Some local variables of type
6325         'struct handler' and 'struct catchtag' are used in this way, so
6326         mark each of their slots as volatile if the slot can be set before
6327         _longjmp and read afterwards.
6328         * lisp.h (struct handler): var and chosen_clause are now volatile.
6329         (struct catchtag): val, next, and pdlcount are now volatile.
6331         * bidi.c (bidi_push_it, bidi_pop_it):
6332         * fns.c (copy_hash_table):
6333         * image.c (define_image_type):
6334         * keyboard.c (kbd_buffer_store_event_hold):
6335         * process.c (Fprocess_send_eof):
6336         * xfaces.c (x_create_gc) [HAVE_NS]:
6337         * xgselect.c (xg_select):
6338         Prefer assignment to memcpy when either will do.
6340         * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6341         Use pointer-to-a-pointer to simplify and avoid a NILP check each
6342         time an item is removed.  No need to mark this function 'inline';
6343         the compiler knows better than we do.
6345 2012-09-11  Jan Djärv  <jan.h.d@swipnet.se>
6347         * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6348         (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6349         to change_frame_size (Bug#12388).
6350         (windowDidResize:): Pass YES to updateFrameSize.
6352         * nsterm.h: Add delay parameter to updateFrameSize.
6354 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
6356         Discard killed buffers from deleted window and frame objects.
6357         This reduces an amount of references to killed buffers and
6358         helps GC to reclaim them faster.
6359         * alloc.c (discard_killed_buffers): New function.
6360         (mark_object): Use it for deleted windows and frames.
6361         (mark_object): If symbol's value is set up for a killed buffer
6362         or deleted frame, restore its global binding.
6363         * data.c (swap_in_global_binding): Add GC notice.
6364         (swap_in_symval_forwarding): Use convenient set_blv_where.
6365         * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6366         * window.h: ... to here.
6368 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
6370         Convenient macro to check whether the buffer is live.
6371         * buffer.h (BUFFER_LIVE_P): New macro.
6372         * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6373         * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6375 2012-09-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
6377         * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6378         composition cases (Bug#12364).
6380         * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6381         overhang of succeeding glyphs overlapping box cursor.
6383         * w32term.c (x_draw_glyph_string): Likewise.
6385 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
6387         Simplify, document, and port floating-point (Bug#12381).
6388         The porting part of this patch fixes bugs on non-IEEE platforms
6389         with frexp, ldexp, logb.
6390         * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6391         Now static.
6392         * floatfns.c: Simplify discussion of functions that Emacs doesn't
6393         support, by removing commented-out code and briefly listing the
6394         C89 functions excluded.  The commented-out stuff was confusing
6395         maintenance, e.g., we thought we needed cbrt but it was commented out.
6396         (logb): Remove decl; no longer needed.
6397         (isfinite): New macro, if not already supplied.
6398         (isnan): Don't replace any existing macro.
6399         (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6400         are present on all C89 platforms.
6401         (Ffrexp): Do not special-case zero, as frexp does the right thing
6402         for that case.
6403         (Flogb): Do not use logb, as it doesn't have the desired meaning
6404         on hosts that use non-base-2 floating point.  Instead, stick with
6405         frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
6406         frexp, to avoid getting an unspecified result.
6408         * xdisp.c (Qinhibit_debug_on_message): Now static.
6410 2012-09-10  Jan Djärv  <jan.h.d@swipnet.se>
6412         * nsterm.m (ns_update_begin): Set clip path to whole view by using
6413         NSBezierPath (Bug#12131).
6415 2012-09-10  Chong Yidong  <cyd@gnu.org>
6417         * fns.c (Fdelq, Fdelete): Doc fix.
6419 2012-09-10  Paul Eggert  <eggert@cs.ucla.edu>
6421         * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6422         (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6424 2012-09-09  Stefan Monnier  <monnier@iro.umontreal.ca>
6426         * lisp.h (make_lisp_ptr): New macro to replace XSET.
6427         (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6428         Use it.
6430 2012-09-09  Eli Zaretskii  <eliz@gnu.org>
6432         * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6433         left fringe if the window has a left margin.  This avoids leaving
6434         traces of the cursor because its leftmost pixel is not drawn over.
6436         * dispnew.c (update_window_line): When the left margin area of a
6437         screen line is updated, set the redraw_fringe_bitmaps_p flag of
6438         that screen line.  (Bug#12277)
6440 2012-09-09  Paul Eggert  <eggert@cs.ucla.edu>
6442         Assume C89 or later for math functions (Bug#12381).
6443         This simplifies the code, and makes it a bit smaller and faster,
6444         and (most important) makes it easier to clean up signal handling
6445         since we can stop worring about floating-point exceptions in
6446         library code.  That was a problem before C89, but the problem
6447         went away many years ago on all practical Emacs targets.
6448         * data.c, image.c, lread.c, print.c:
6449         Don't include <math.h>; no longer needed.
6450         * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6451         might be autoconfigured, as that never happens.
6452         * data.c (fmod):
6453         * doprnt.c (DBL_MAX_10_EXP):
6454         * print.c (DBL_DIG):
6455         Remove.  C89 or later always defines these.
6456         * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6457         (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6458         (arith_error, domain_error, domain_error2):
6459         Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
6460         no longer needed -- we simply return what C returns.  All uses removed.
6461         (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
6462         the wrapped code.
6463         (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6464         Remove.  All uses expanded, as these macros are no longer used
6465         more than once and are now more trouble than they're worth.
6466         (Ftan): Use tan, not sin / cos.
6467         (Flogb): Assume C89 frexp.
6468         (fmod_float): Assume C89 fmod.
6469         (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6470         (init_floatfns): Remove.  All uses removed.
6472 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
6474         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6475         compositeToPoint for OSX < 10.6 (Bug#12390).
6477 2012-09-08  Paul Eggert  <eggert@cs.ucla.edu>
6479         * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6480         This produces more-accurate results.
6482 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
6484         * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6485         changes (Bug#12088).
6487 2012-09-08  Chong Yidong  <cyd@gnu.org>
6489         * syntax.c (Fstring_to_syntax): Doc fix.
6491 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
6493         * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6494         in the internal border.
6495         (x_set_window_size): Remove static variables and their usage.
6496         (ns_redraw_scroll_bars): Fix NSTRACE arg.
6497         (ns_after_update_window_line, ns_draw_fringe_bitmap):
6498         Remove fringe/internal border adjustment (Bug#11052).
6499         (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6500         (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6501         (ns_fix_rect_ibw): Remove.
6502         (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6503         (ns_dumpglyphs_box_or_relief): Ditto.
6504         (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6505         adjustment.
6506         (ns_dumpglyphs_image): Ditto.
6507         (ns_dumpglyphs_stretch): Fix coding style.  Remove fringe/internal
6508         border adjustment.
6509         (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6510         their usage.  Add fringe_extended_p and its use as in other terms.
6511         (ns_judge_scroll_bars): Code style fix.  Call updateFrameSize if
6512         scroll bar was removed.
6513         (updateFrameSize): New function.
6514         (windowDidResize): Move code to updateFrameSize and call it.
6516         * nsterm.h (EmacsView): Add updateFrameSize.
6518 2012-09-07  Chong Yidong  <cyd@gnu.org>
6520         * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6522         * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6524 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
6526         More signal-handler cleanup (Bug#12327).
6527         * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6528         Problem introduced when merging patches.  Noted by Eli Zaretskii in
6529         <http://bugs.gnu.org/12327#67>.
6530         * floatfns.c: Comment fix.
6531         * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6532         SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6533         and anyway the declaration is harmless even if SIGDANGER is not defined.
6534         * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6535         defined BROKEN_FIONREAD).  systty.h formerly did this, but other
6536         source files not surprisingly expected syssignal.h to define, or
6537         not define, SIGIO, and it's cleaner to do it that way, for consistency.
6538         Include <sys/ioctl.h>, for FIONREAD.
6539         * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6540         This eliminates a problem whereby other files mysteriously had
6541         to include "syssignal.h" before including "systty.h" if they
6542         wanted to use "#ifdef SIGIO".
6544 2012-09-07  Eli Zaretskii  <eliz@gnu.org>
6546         * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6548         * w32.c (sigemptyset): Empty the set.
6549         (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6551         * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6553 2012-09-07  Dmitry Antipov  <dmantipov@yandex.ru>
6555         * alloc.c (mark_buffer): Revert unsafe marking optimization.
6556         (mark_object): Likewise for frame objects.
6558 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
6560         * syssignal.h (handle_on_main_thread): Always declare,
6561         even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6562         This ports to platforms without HAVE_PTHREAD.
6564 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
6566         Signal-handler cleanup (Bug#12327).
6567         Emacs's signal handlers were written in the old 4.2BSD style with
6568         sigblock and sigmask and so forth, and this led to some
6569         inefficiencies and confusion.  Rewrite these to use
6570         pthread_sigmask etc. without copying signal sets around.  Also,
6571         get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6572         'signal', and instead use functions that do not attempt to take
6573         over the system name space.  This patch causes Emacs's text
6574         segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6575         * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6576         Do not include <signal.h> or "syssignal.h", as these
6577         modules do not use signals.
6578         * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6579         * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6580         Do not include <signal.h>, as "syssignal.h" does that for us now.
6581         * atimer.c (sigmask_atimers): New function.
6582         (block_atimers, unblock_atimers): New functions,
6583         replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6584         All uses replaced.
6585         * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6586         no longer needed here.
6587         * emacs.c (main): Inspect existing signal handler with sigaction,
6588         so that there's no need to block and unblock SIGHUP.
6589         * sysdep.c (struct save_signal): New member 'action', replacing
6590         old member 'handler'.
6591         (save_signal_handlers, restore_signal_handlers):
6592         Use sigaction instead of 'signal' to save and restore.
6593         (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6594         New function.  All users of 'signal' modified to use set_sighandler
6595         if they're writeonly, and to use sys_signal if they're read+write.
6596         (emacs_sigaction_init, forwarded_signal): New functions.
6597         (sys_signal): Remove.  All uses replaced by calls to sigaction
6598         and emacs_sigaction_init, or by direct calls to 'signal'.
6599         (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6600         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6601         all uses replaced by pthread_sigmask etc. calls.
6602         * syssignal.h: Include <signal.h>.
6603         (emacs_sigaction_init, forwarded_signal): New decls.
6604         (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
6605         (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6606         (sigmask, sys_sigmask): Remove; no longer needed.
6607         (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
6608         (sigblock, sigunblock, sigfree):
6609         (sigsetmask) [!defined sigsetmask]:
6610         Remove.  All uses replaced by pthread_sigmask.
6611         (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
6612         no longer need to be replaced, and its typical old uses
6613         are now done via emacs_sigaction_init and sigaction.
6614         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6615         (sys_sigdel): Remove; unused.
6616         (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
6618 2012-09-06  Eli Zaretskii  <eliz@gnu.org>
6620         * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6621         SIGCHLD handling on systems that don't have WNOHANG.  (Bug#12327)
6623 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
6625         Explicitly mark buffer_defaults and buffer_local_symbols.
6626         * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6627         mark_local_symbols here.
6628         (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6629         since special buffers aren't marked here any more.
6630         (allocate_buffer): Chain new buffer with all_buffers here...
6631         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6632         not here.
6633         (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6634         (syms_of_buffer): Remove staticpro of the above.
6635         (init_buffer_once): Set names for buffer_defaults and
6636         buffer_local_symbols.
6638 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
6640         Use bool for booleans in font-related modules.
6641         * font.c (font_intern_prop, font_style_to_value)
6642         (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6643         (generate_otf_features, font_check_otf_features, font_check_otf)
6644         (font_match_p, font_list_entities, font_at):
6645         * fontset.c (fontset_id_valid_p, reorder_font_vector
6646         (fontset_find_font, Fset_fontset_font)
6647         (face_suitable_for_char_p) [0]:
6648         * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6649         (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6650         (m17n_flt_initialized, ftfont_shape_by_flt):
6651         * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6652         * nsfont.m (nsfont_draw):
6653         * w32font.c (w32font_draw):
6654         * w32term.c (x_draw_glyphless_glyph_string_foreground):
6655         Use bool for booleans.
6656         * font.h: Adjust to above API changes.
6657         (struct font, struct font_driver, struct font_driver_list):
6658         Use bool for booleans.
6659         (struct font): Remove useless member encoding_type.
6660         All users removed.
6661         * fontset.c, xftfont.c: Omit unnecessary static decls.
6663 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
6665         * alloc.c (mark_object): Revert window marking code
6666         since it's unsafe for the Fset_window_configuration.
6668 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
6670         Fix race conditions with signal handlers and errno (Bug#12327).
6671         Be more systematic about preserving errno whenever a signal
6672         handler returns, even if it's not in the main thread.  Do this by
6673         renaming signal handlers to distinguish between signal delivery
6674         and signal handling.  All uses changed.
6675         * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6676         * data.c (deliver_arith_signal): Rename from arith_error.
6677         * dispnew.c (deliver_window_change_signal): Rename from
6678         window_change_signal.
6679         * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6680         (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6681         * keyboard.c (deliver_input_available_signal): Rename from
6682         input_available_signal.
6683         (deliver_user_signal): Rename from handle_user_signal.
6684         (deliver_interrupt_signal): Rename from interrupt_signal.
6685         * process.c (deliver_pipe_signal): Rename from send_process_trap.
6686         (deliver_child_signal): Rename from sigchld_handler.
6687         * atimer.c (handle_alarm_signal):
6688         * data.c (handle_arith_signal):
6689         * dispnew.c (handle_window_change_signal):
6690         * emacs.c (handle_fatal_signal, handle_danger_signal):
6691         * keyboard.c (handle_input_available_signal):
6692         * keyboard.c (handle_user_signal, handle_interrupt_signal):
6693         * process.c (handle_pipe_signal, handle_child_signal):
6694         New functions, with the actual signal-handling code taken from the
6695         original respective signal handlers, sans the sporadic attempts to
6696         preserve errno, since that's now done by handle_on_main_thread.
6697         * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6698         * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6699         * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6700         Move to sysdep.c.
6701         (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6702         Move initialization of main_thread to sysdep.c's init_signals.
6703         * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6704         our usage, and simplifies the mainline code.
6705         (record_child_status_change): New static function, as a helper
6706         for handle_child_signal, and with most of the old child handler's
6707         contents.
6708         (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6709         (handle_child_signal): Use the above.
6710         * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6711         Moved here from emacs.c.
6712         (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6713         code moved here from emacs.c's main function.
6714         * sysdep.c, syssignal.h (handle_on_main_thread): New function,
6715         replacing the old SIGNAL_THREAD_CHECK.  All uses changed.
6716         This lets callers save and restore errno properly.
6718 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
6720         Remove redundant or unused things here and there.
6721         * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6722         * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6723         * editfns.c (Fcompare_buffer_substrings): Likewise.
6724         * frame.h (struct terminal, struct font_driver_list):
6725         Remove redundant declarations.
6726         * window.h (Qleft, Qright): Likewise.
6728 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
6730         Do not mark objects from deleted buffers, windows and frames.
6731         * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6732         (mark_object): Likewise for windows and frames.
6734 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
6736         * alloc.c (valid_lisp_object_p): Treat killed buffers,
6737         buffer_defaults and buffer_local_symbols as valid objects.
6738         Return special value to denote them.
6740 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
6742         * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6743         * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6744         (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6745         (file_name_absolute_p, Fsubstitute_in_file_name):
6746         (check_executable, check_writable, Ffile_accessible_directory_p)
6747         (Fset_file_selinux_context, Fdefault_file_modes)
6748         (Finsert_file_contents, choose_write_coding_system)
6749         (Fwrite_region, build_annotations, a_write, e_write)
6750         (Fdo_auto_save):
6751         * filelock.c (boot_time_initialized, get_boot_time)
6752         (get_boot_time_1, lock_file_1, within_one_second):
6753         * floatfns.c (in_float):
6754         * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6755         (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6756         (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6757         * lisp.h (struct Lisp_Hash_Table.cmpfn):
6758         * window.c (compare_window_configurations):
6759         Use bool for booleans.
6760         * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6761         (Fdefault_file_modes): Now mode_t, not int, for modes.
6762         (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6763         (internal_delete_file): Now returns void, not a (boolean) int,
6764         since nobody was looking at the return value.
6765         * lisp.h, window.h: Adjust to above API changes.
6767         * xdisp.c (set_message): Simplify and reindent last change.
6769 2012-09-05  Juanma Barranquero  <lekktu@gmail.com>
6771         * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6773 2012-09-04  Lars Ingebrigtsen  <larsi@gnus.org>
6775         * eval.c (call_debugger): Make the function non-static so that we
6776         can call it from set_message.
6778         * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6779         (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6781 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
6783         Give more-useful info on a fatal error (Bug#12328).
6784         * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6785         (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6786         of doing the work ourselves.
6787         * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6788         do most of the work.
6789         (fatal_error_backtrace): New function, taken from the guts
6790         of the old fatal_error_signal, but with a new option to output
6791         a backtrace.
6792         (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6793         info about the signal than just its number.
6794         * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6795         * sysdep.c: Include <execinfo.h>
6796         (emacs_backtrace): New function, taken partly from the previous
6797         code of the 'die' function.
6798         (emacs_abort): Call fatal_error_backtrace rather than abort.
6800 2012-09-04  Stefan Monnier  <monnier@iro.umontreal.ca>
6802         * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6803         eager (load-time) macro-expansion.
6804         * lisp.mk (lisp): Add macroexp.
6806 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
6808         Simplify redefinition of 'abort' (Bug#12316).
6809         Do not try to redefine the 'abort' function.  Instead, redo
6810         the code so that it calls 'emacs_abort' rather than 'abort'.
6811         This removes the need for the NO_ABORT configure-time macro
6812         and makes it easier to change the abort code to do a backtrace.
6813         * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6814         * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6815         Remove; sysdep.c's emacs_abort now takes its place.
6816         * lisp.h (emacs_abort): New decl.  All calls from Emacs code to
6817         'abort' changed to use 'emacs_abort'.
6818         * msdos.c (dos_abort) [defined abort]: Remove; not used.
6819         (abort) [!defined abort]: Rename to ...
6820         (emacs_abort): ... new name.
6821         * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6822         the place of the old 'abort' in emacs.c.
6823         * w32.c, w32fns.c (abort): Do not #undef.
6824         * w32.c (emacs_abort): Rename from w32_abort.
6826 2012-09-04  Eli Zaretskii  <eliz@gnu.org>
6828         * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6829         offsets[j].dv, since the y axis of the screen coordinates points
6830         down, while the y axis of the font definition coordinates points
6831         up.  This fixes display of Arabic diacritics such as KASRA and
6832         KASRATAN.  (Bug#11860)
6834 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
6836         Be more systematic about _setjmp vs setjmp.
6837         * alloc.c (test_setjmp, mark_stack):
6838         * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6839         (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6840         (png_load, my_error_exit, jpeg_load):
6841         * process.c (send_process_trap, send_process):
6842         Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6843         The underscored versions are up to 30x faster on some hosts.
6844         Formerly, the code used setjmp+longjmp sometimes and
6845         _setjmp+_longjmp at other times, with no particular reason to
6846         prefer setjmp+longjmp.
6848 2012-09-03  Paul Eggert  <eggert@cs.ucla.edu>
6850         Fix minor problem found by static checking.
6851         * buffer.c (Fdelete_all_overlays): Return nil.
6853 2012-09-03  Martin Rudalics  <rudalics@gmx.at>
6855         * buffer.c (Fdelete_all_overlays): New function.
6857 2012-09-03  Chong Yidong  <cyd@gnu.org>
6859         * gtkutil.c: Add extern decl for Qxft.
6861 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
6863         * emacs.c, eval.c: Use bool for boolean.
6864         * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6865         (malloc_using_checking) [DOUG_LEA_MALLOC]:
6866         (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6867         (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6868         (main, decode_env_path, Fdaemon_initialized):
6869         * eval.c (call_debugger, Finteractive_p, interactive_p):
6870         (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6871         (maybe_call_debugger, Fbacktrace):
6872         * process.c (read_process_output, exec_sentinel):
6873         Use bool for booleans.
6874         * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6875         All callers changed.
6876         * eval.c (interactive_p): Omit always-true boolean argument
6877         EXCLUDE_SUBRS_P.  All callers changed.
6878         * dispextern.h, lisp.h: Reflect above API changes.
6879         * firstfile.c (dummy): Use the address of 'main', whose signature
6880         won't change, instead of the address of 'initialize', whose
6881         signature just changed from int to bool.
6882         * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6883         * msdos.c (fatal_error_in_progress): ... from here.
6884         * xdisp.c (redisplaying_p): Now a boolean.  Set it to 1 instead
6885         of incrementing it.
6886         (redisplay_internal, unwind_redisplay): Simply clear
6887         REDISPLAYING_P when unwinding, instead of saving its previous,
6888         always-false value and then restoring it.
6890         Clean up some extern decls.
6891         Mostly, this hoists extern decls out of .c files and into .h files.
6892         That way, we're more likely to catch errors if the interfaces change.
6893         * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6894         declare xg_mark_data.
6895         * dispextern.h (x_frame_parm_handlers):
6896         * font.h (Qxft):
6897         * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6898         (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6899         (Qultra_bold, Qoblique, Qitalic):
6900         Move extern decl here from .c file.
6901         * alloc.c (xg_mark_data) [USE_GTK]:
6902         * doc.c (Qclosure):
6903         * eval.c (Qlexical_binding):
6904         * fns.c (time) [!HAVE_UNISTD_H]:
6905         * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6906         (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6907         * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6908         * lread.c (Qinternal_interpreter_environment):
6909         * minibuf.c (Qbuffer):
6910         * process.c (QCfamily, QCfilter):
6911         * widget.c (free_frame_faces):
6912         * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6913         * xfont.c (x_clear_errors):
6914         * xterm.c (x_frame_parm_handlers):
6915         Remove now-redundant extern decls.
6916         * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6917         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6918         Now static.
6919         * xfaces.c: Remove unnecessary static decls.
6920         * xterm.c (updating_frame): Remove decl of nonexistent object.
6922         * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6923         when building globals.h, as the objects that are not built on
6924         this host are not needed to compile C files on this host.
6926 2012-09-02  Jan Djärv  <jan.h.d@swipnet.se>
6928         * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6930         * frame.h: Add missing prototype for x_wm_set_size_hint.
6932 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
6934         * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6935         * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6936         (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6937         (Fsubstitute_command_keys):
6938         * editfns.c (region_limit, find_field, Fconstrain_to_field)
6939         (save_excursion_save, save_excursion_restore)
6940         (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6941         (format_time_string, general_insert_function)
6942         (make_buffer_string, make_buffer_string_both)
6943         (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6944         * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6945         (copy_text, insert_1, insert_1_both, insert_from_string)
6946         (insert_from_string_before_markers, insert_from_string_1)
6947         (insert_from_buffer, insert_from_buffer_1, replace_range)
6948         (replace_range_2, del_range_1, del_range_byte, del_range_both)
6949         (del_range_2, modify_region):
6950         * intervals.c (intervals_equal, balance_possible_root_interval)
6951         (adjust_intervals_for_insertion, merge_properties_sticky)
6952         (graft_intervals_into_buffer, lookup_char_property)
6953         (adjust_for_invis_intang, set_point_both)
6954         (get_property_and_range, compare_string_intervals)
6955         (set_intervals_multibyte_1, set_intervals_multibyte):
6956         * keyboard.c (decode_timer):
6957         Use bool for boolean.
6958         * intervals.h, lisp.h, systime.h: Reflect above API changes.
6959         * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6961 2012-09-02  Chong Yidong  <cyd@gnu.org>
6963         * keymap.c (push_key_description): Print M-TAB as C-M-i
6964         (Bug#11758).
6966 2012-09-02  Juanma Barranquero  <lekktu@gmail.com>
6968         * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6969         (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6970         ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6971         ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6972         ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6973         ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6974         ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6976 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
6978         * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6979         more than one grapheme cluster passed to the shaper: compute the
6980         offset adjustment values separately for each cluster.  (Bug#11860)
6982         * image.c: Restore mistakenly removed inclusion of w32.h.  Without
6983         it, GCC doesn't see prototypes of w32_delayed_load, and complains
6984         about implicit conversions from integer to pointer.
6986 2012-09-01  Daniel Colascione  <dancol@dancol.org>
6988         * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6989         system used too early.
6991 2012-09-01  Paul Eggert  <eggert@cs.ucla.edu>
6993         Better seed support for (random).
6994         * emacs.c (main): Call init_random.
6995         * fns.c (Frandom): Set the seed from a string argument, if given.
6996         Remove long-obsolete Gentzel cruft.
6997         * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6998         (init_random): New function.
7000 2012-09-01  Daniel Colascione  <dancol@dancol.org>
7002         * xterm.h: Add header guards.  Declare x_menubar_window_to_frame.
7003         Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7004         x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7005         x_wm_set_size_hint, x_query_colors, x_real_positions,
7006         x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7007         x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7008         all of which have been moved to common code.
7010         * xfaces.c: Include TERM_HEADER instead of listing all possible
7011         window-system headers.
7013         * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7014         to match header.
7016         * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7017         directly accessing frame internals.
7019         * w32font.h: Include font.h.  Define syms_of_w32font and
7020         globals_of_w32font.
7022         * process.c: Include TERM_HEADER instead of listing all possible
7023         window-system headers.
7025         * nsterm.h: Remove declarations now in frame.h.
7026         Define FRAME_X_SCREEN, FRAME_X_VISUAL.
7028         * menu.c: Include TERM_HEADER instead of listing all possible
7029         window-system headers.
7031         * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7032         window system.
7034         * keyboard.c: Include TERM_HEADER instead of listing all possible
7035         window-system headers.
7037         * image.c: Include TERM_HEADER instead of listing all possible
7038         window-system headers.  Declare Vlibrary_cache when compiling for
7039         Windows.
7041         * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7042         window system declarations.
7044         * frame.h: Move common functions here: set_frame_menubar,
7045         x_set_window_size, x_sync, x_get_focus_frame,
7046         x_set_mouse_position, x_set_mouse_pixel_position,
7047         x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7048         x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7049         x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7050         x_activate_menubar, x_real_positions, x_bitmap_icon,
7051         x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7052         and x_query_colors.
7054         * frame.c: Include TERM_HEADER instead of listing all possible
7055         window-system headers.
7057         * font.c: Include TERM_HEADER instead of listing all possible
7058         window-system headers.
7060         * emacs.c: Include TERM_HEADER.
7062         * dispnew.c: Include TERM_HEADER instead of listing all possible
7063         window-system headers.
7065         * ccl.h: Include character.h.
7067         * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7068         the current window system; include in list of objects to link into
7069         Emacs.
7071 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
7073         Remove mark_ttys function and fix tty_display_info initialization.
7074         * lisp.h (mark_ttys): Remove prototype.
7075         * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7076         to mark_ttys because all possible values of 'top_frame' slot are
7077         the frames which are reachable from Vframe_list.
7078         * term.c (mark_ttys): Remove.
7079         (init_tty): Safely initialize 'top_frame' slot with Qnil.
7081 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
7083         Change struct frame bitfields from unsigned char to unsigned.
7084         * frame.h (struct frame): Change type of 'display_preempted',
7085         'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7086         'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7087         'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7088         bitfields from unsigned char to unsigned.
7090 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
7092         Remove unused member of struct x_output and struct w32_output.
7093         * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7094         * w32term.h (struct w32_output): Likewise.
7096 2012-08-30  Jan Djärv  <jan.h.d@swipnet.se>
7098         * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7099         does not become zero (Bug#12234).
7101 2012-08-30  Paul Eggert  <eggert@cs.ucla.edu>
7103         * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7104         for GCC 4.7.1 x86-64.
7106 2012-08-30  Glenn Morris  <rgm@gnu.org>
7108         * lread.c (init_lread): For out-of-tree builds, only add the
7109         source directory's site-lisp dir to the load-path if it exists,
7110         consistent with in-tree builds.  (Bug#12302)
7112 2012-08-28  Jan Djärv  <jan.h.d@swipnet.se>
7114         * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
7115         button_values to NULL.  Call setStykeMask so dialogs get a close button.
7116         (windowShouldClose:): Set window_closed.
7117         (dealloc): New member, free button_values.
7118         (process_dialog:): Make member function.  Remove window argument,
7119         replace window with self.  Count buttons and allocate and store values
7120         in button_values.
7121         (addButton:value:row:): value is int with the name tag.  Call setTag
7122         with tag.  Remove return self, declare return value as void.
7123         (addString:row:): Remove return self, declare return value as void.
7124         (addSplit): Remove return self, declare return value as void.
7125         (clicked:): Remove return self, declare return value as void.
7126         Set dialog_return to button_values[seltag].  Code formatting change.
7127         (initFromContents:isQuestion:): Adjust call to process_dialog.
7128         Code formatting change.
7129         (timeout_handler:): Set timer_fired to YES.
7130         (runDialogAt:): Set timer_fired to NO.
7131         Handle click on close button as quit.
7133         * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7134         Add window_closed and button_values.  Add void as return value for
7135         add(Button|String|Split).  addButton takes int instead of Lisp_Object.
7136         Add process_dialog as new member.
7138 2012-08-28  Eli Zaretskii  <eliz@gnu.org>
7140         * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7141         is not one of the heaps we manage.  (Bug#12242)
7143 2012-08-28  Glenn Morris  <rgm@gnu.org>
7145         * eval.c (Fcalled_interactively_p): Doc fix.  (Bug#11747)
7147 2012-08-28  Martin Rudalics  <rudalics@gmx.at>
7149         * window.c (Fset_window_configuration): Remove handling of
7150         auto-buffer-name window parameter.  Install revision of reverted
7151         fix.
7153 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
7155         Do not allow to set major mode for a dead buffer.
7156         * buffer.c (Fset_buffer_major_mode): Signal an error
7157         if the buffer is dead.
7158         (Fother_buffer, other_buffer_safely): Remove redundant
7159         nested declaration.
7161 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
7163         Always use set_buffer_if_live to restore original buffer at unwind.
7164         * buffer.h (record_unwind_current_buffer): New function.
7165         * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7166         * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7167         * undo.c, window.c: Adjust users.
7168         * buffer.c (set_buffer_if_live): Fix comment.
7170 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
7172         Fix usage of set_buffer_internal.
7173         * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7174         * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7175         * coding.c (decode_coding): Omit redundant test.
7176         * fileio.c (decide_coding_unwind): Likewise.
7177         * fns.c (secure_hash): Likewise.
7178         * insdel.c (modify_region): Likewise.
7179         * keyboard.c (command_loop_1): Likewise.
7180         * print.c (PRINTFINISH): Likewise.
7181         * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7183 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
7185         * dispnew.c: Use bool for boolean.
7186         (frame_garbaged, display_completed, delayed_size_change)
7187         (fonts_changed_p, add_window_display_history)
7188         (add_frame_display_history, verify_row_hash)
7189         (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7190         (row_equal_p, realloc_glyph_pool)
7191         (allocate_matrices_for_frame_redisplay)
7192         (showing_window_margins_p)
7193         (adjust_frame_glyphs_for_frame_redisplay)
7194         (build_frame_matrix_from_leaf_window, make_current)
7195         (mirrored_line_dance, mirror_line_dance, update_frame)
7196         (update_window_tree, update_single_window)
7197         (check_current_matrix_flags, update_window, update_text_area)
7198         (update_window_line, set_window_update_flags, scrolling_window)
7199         (update_frame_1, scrolling, buffer_posn_from_coords)
7200         (do_pending_window_change, change_frame_size)
7201         (change_frame_size_1, sit_for):
7202         Use bool for boolean.
7203         (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7204         and remove last int (actually boolean) argument, which was always 0.
7205         All callers changed.
7206         * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7207         * dispextern.h (struct composition_it): Use bool for boolean.
7208         (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7209         (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7210         * dired.c (file_name_completion):
7211         Use bool for boolean.  (This was missed in an earlier change.)
7213 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
7215         * window.c (Fset_window_configuration): Revert first part of
7216         last change.
7218 2012-08-27  Jan Djärv  <jan.h.d@swipnet.se>
7220         * nsterm.h (NSPanel): New class variable dialog_return.
7222         * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7223         Initialize dialog_return.
7224         (windowShouldClose:): Use stop instead of stopModalWithCode.
7225         (clicked:): Ditto, and also set dialog_return (Bug#12258).
7226         (timeout_handler:): Use stop instead of abortModal.  Send a dummy
7227         event.
7228         (runDialogAt:): Make ret Lisp_Object.  Set it from dialog_return when
7229         modal loop returns.
7231 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
7233         * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7234         * composite.c (find_composition, composition_gstring_p)
7235         (composition_reseat_it, find_automatic_composition):
7236         * data.c (let_shadows_buffer_binding_p)
7237         (let_shadows_global_binding_p, set_internal, make_blv)
7238         (Fmake_variable_buffer_local, Fmake_local_variable)
7239         (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7240         (cons_to_signed, arith_driver):
7241         * dbusbind.c (xd_in_read_queued_messages):
7242         * dired.c (directory_files_internal, file_name_completion):
7243         Use bool for booleans.
7244         * dired.c (file_name_completion):
7245         * process.h (fd_callback):
7246         Omit int (actually boolean) argument.  It wasn't being used.
7247         All uses changed.
7248         * composite.h, lisp.h: Reflect above API changes.
7250         * cmds.c, coding.c: Use bool for booleans.
7251         * cmds.c (move_point, Fself_insert_command):
7252         * coding.h (struct composition status, struct coding_system):
7253         * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7254         (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7255         (emacs_mule_char, decode_coding_emacs_mule)
7256         (encode_coding_emacs_mule, detect_coding_iso_2022)
7257         (decode_coding_iso_2022, encode_invocation_designation)
7258         (encode_designation_at_bol, encode_coding_iso_2022)
7259         (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7260         (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7261         (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7262         (encode_coding_raw_text, detect_coding_charset)
7263         (decode_coding_charset, encode_coding_charset, detect_eol)
7264         (detect_coding, get_translation_table, produce_chars)
7265         (consume_chars, reused_workbuf_in_use)
7266         (make_conversion_work_buffer, code_conversion_save)
7267         (decode_coding_object, encode_coding_object)
7268         (detect_coding_system, char_encodable_p)
7269         (Funencodable_char_position, code_convert_region)
7270         (code_convert_string, code_convert_string_norecord)
7271         (Fset_coding_system_priority):
7272         * fileio.c (Finsert_file_contents):
7273         Use bool for booleans.
7274         * coding.h, lisp.h: Reflect above API changes.
7275         * coding.c: Remove unnecessary static function decls.
7276         (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7277         (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7278         not a boolean 'int', since callers never look at the return value.
7279         (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7280         * coding.h (decoding_buffer_size, encoding_buffer_size)
7281         (emacs_mule_string_char): Remove unused extern decls.
7282         (struct iso_2022_spec, struct coding_system):
7283         Use 'unsigned int : 1' for boolean fields, since there's more than one.
7284         (struct emacs_mule_spec): Remove unused field 'full_support'.
7285         All initializations removed.
7286         * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7288 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
7290         Fix spare memory change (Bug#12286).
7291         * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7292         (valid_lisp_object_p): Likewise.
7294 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
7296         * window.c (Fset_window_configuration): Record any window's old
7297         buffer if it's replaced (see Bug#8789).  If the new current
7298         buffer doesn't appear in the selected window, go to its old
7299         point (Bug#12208).
7301 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
7303         Special MEM_TYPE_SPARE to denote reserved memory.
7304         * alloc.c (enum mem_type): New memory type.
7305         (refill_memory_reserve): Use new type for spare memory.
7306         This prevents live_cons_p and live_string_p from incorrect
7307         detection of uninitialized objects from spare memory as live.
7309 2012-08-26  Paul Eggert  <eggert@cs.ucla.edu>
7311         Spelling fixes.
7312         * Makefile.in (.PHONY): versioclean -> versionclean.
7314         Remove unused external symbols.
7315         * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7316         * window.c (Qwindow_valid_p, decode_valid_window):
7317         Now static, not extern.
7318         * data.c (Qinterval): Remove; unused.
7319         (syms_of_data): Do not define 'interval'.
7320         * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7321         * window.h (decode_valid_window):
7322         Remove decls.
7324         * character.c, charset.c, chartab.c: Use bool for booleans.
7325         * character.c (lisp_string_width, string_count_byte8)
7326         (string_escape_byte8):
7327         * charset.c (charset_map_loaded, load_charset_map, read_hex):
7328         (load_charset_map_from_file, map_charset_chars)
7329         (Fdefine_charset_internal, define_charset_internal)
7330         (Fdeclare_equiv_charset, find_charsets_in_text)
7331         (Ffind_charset_region, char_charset, Fiso_charset):
7332         * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7333         (sub_char_table_set, sub_char_table_set_range)
7334         (char_table_set_range, optimize_sub_char_table)
7335         (map_sub_char_table):
7336         Use bool for boolean.
7337         * character.c (str_to_unibyte): Omit last boolean argument; it was
7338         always 0.  All callers changed.
7339         * character.h, charset.h: Adjust to match previous changes.
7340         * character.h (char_printable_p): Remove decl of nonexistent function.
7341         * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7342         ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7343         are all boolean, so make them single-bit bitfields.
7345         * lisp.h (ASET): Remove attempt to detect side effects.
7346         It was meant to be temporary and it often doesn't work,
7347         because when IDX has side effects the behavior of IDX==IDX
7348         is undefined.  See Stefan Monnier in
7349         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7351 2012-08-26  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
7353         * lisp.h (functionp): New function (extracted from Ffunctionp).
7354         (FUNCTIONP): Use it.
7355         * eval.c (Ffunctionp): Use it.
7357 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
7359         * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7360         as that's faster and simpler than static storage.  Don't bother
7361         with the g_main_context_query overhead if g_main_context_pending
7362         says no events are pending.
7363         (gfds, gfds_size): Remove these static vars.
7364         (xgselect_initialize): Remove; no longer needed.
7365         All uses and decls removed.
7367         * emacs.c (fatal_error_signal_hook): Remove.
7368         All uses removed.  This leftover from old code was always 0.
7370         * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7371         * casefiddle.c (casify_object, casify_region):
7372         * casetab.c (set_case_table):
7373         * category.c, category.h (word_boundary_p):
7374         * category.h (CHAR_HAS_CATEGORY):
7375         Use bool for booleans, instead of int.
7377 2012-08-25  Eli Zaretskii  <eliz@gnu.org>
7379         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7381 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
7383         On assertion failure, print backtrace if available.
7384         * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7385         (die) [ENABLE_CHECKING]: Print a backtrace if available.
7386         * Makefile.in (LIB_EXECINFO): New macro.
7387         (LIBES): Use it.
7389         * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7390         * bytecode.c (exec_byte_code):
7391         * callint.c (check_mark, Fcall_interactively):
7392         * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7393         (getenv_internal, sync_process_alive, call_process_exited):
7394         * lisp.h (USE_SAFE_ALLOCA):
7395         Use bool for booleans, instead of int.
7396         * lisp.h, process.h: Adjust prototypes to match above changes.
7397         * callint.c (Fcall_interactively): Don't assume the mark's
7398         offset fits in 'int'.
7400 2012-08-24  Paul Eggert  <eggert@cs.ucla.edu>
7402         * buffer.c, buffer.h: Use bool for boolean.
7403         * buffer.c (reset_buffer_local_variables)
7404         (buffer_lisp_local_variables, Fset_buffer_modified_p)
7405         (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7406         (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7407         (overlay_touches_p, overlay_strings, Foverlay_put)
7408         (report_overlay_modification, call_overlay_mod_hooks):
7409         (mmap_enlarge, mmap_set_vars):
7410         * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7411         Use bool for booleans, instead of int.
7412         * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7413         since the 1-or-0 return value is always ignored anyway.
7414         (mmap_initialized_p):
7415         * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7416         * buffer.h, lisp.h: Adjust prototypes to match above changes.
7418 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
7420         * bidi.c: Use bool for boolean.
7421         This is a bit more readable, and makes the text segment of bidi.o
7422         0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7423         Presumably it's faster too.
7424         (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7425         Now bool.
7426         (bidi_cache_find_level_change, bidi_cache_iterator_state)
7427         (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7428         (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7429         (bidi_explicit_dir_char, bidi_level_of_next_char)
7430         (bidi_find_other_level_edge, bidi_move_to_visually_next):
7431         Use bool for booleans, instead of int.
7432         * dispextern.h (bidi_init_it, bidi_paragraph_init)
7433         (bidi_unshelve_cache): Adjust decls to match code.
7435 2012-08-23  Martin Rudalics  <rudalics@gmx.at>
7437         * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7438         argument.
7440 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
7442         * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7443         * atimer.h: Include <stdbool.h>.
7445 2012-08-22  Dan Nicolaescu  <dann@gnu.org>
7447         * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7448         compile time tests instead of run time tests on systems that do
7449         not use them.
7450         (FRAME_MAC_P): Remove leftover from deleted code.
7451         * frame.c (syms_of_frame): Remove leftover from deleted code.
7453 2012-08-22  Jan Djärv  <jan.h.d@swipnet.se>
7455         * nsterm.m (insertText:): Don't clear modifiers if code is space.
7457 2012-08-22  Paul Eggert  <eggert@cs.ucla.edu>
7459         * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7460         Otherwise, the compiler complains about (A?B:C) where B is void
7461         and C is Lisp_Object.  This fixes an incompatibility with Sun C 5.12.
7462         (fontset_add): Return void, for FONTSET_ADD.
7464 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
7466         * alloc.c: Use bool for booleans.
7467         (gc_in_progress, abort_on_gc)
7468         (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7469         (dont_register_blocks) [GC_MALLOC_CHECK]:
7470         (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7471         (check_string_bytes, make_specified_string, memory_full)
7472         (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7473         (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7474         (mark_stack, valid_pointer_p, make_pure_string)
7475         (Fgarbage_collect, survives_gc_p, gc_sweep):
7476         Use bool for booleans, instead of int.
7477         (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7478         Remove unused local.
7479         * alloc.c (PURE_POINTER_P):
7480         * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7481         * editfns.c (Fformat):
7482         * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7483         (Fdo_auto_save):
7484         * fns.c (sweep_weak_table):
7485         * lisp.h (suppress_checking, push_message, survives_gc_p)
7486         (make_pure_string, gc_in_progress, abort_on_gc):
7487         * lread.c (readchar, read1):
7488         * print.c (Fprin1_to_string):
7489         * xdisp.c (push_message):
7490         Use bool for booleans affected directly or indirectly by
7491         alloc.c's changes.
7493         Make recently-introduced setters macros.
7494         * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7495         (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7496         (set_fontset_default, set_fontset_fallback): Rename from their
7497         upper-case counterparts, and make them functions rather than macros.
7498         This is more consistent with the other recently-introduced setters.
7499         These don't need to be inline, since they're local.
7501 2012-08-21  Jan Djärv  <jan.h.d@swipnet.se>
7503         * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7504         the loop (Bug#12247).
7506 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
7508         * lisp.h (vcopy): Use memcpy rather than our own loop.
7509         This fixes a performance regression introduced by the recent
7510         addition of vcopy.  This means 'vcopy' will need to be modified
7511         for a copying collector, but that's OK.  Also, tighten the
7512         checking in the assertion.
7514 2012-08-21  Eli Zaretskii  <eliz@gnu.org>
7516         * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7517         components for RTL text (Bug#11860).  Adjust X-OFFSET of each
7518         non-base glyph for the width of the base character, according to
7519         what x_draw_composite_glyph_string_foreground expects.
7520         Generate WADJUST value according to composition_gstring_width's
7521         expectations, to produce correct width of the composed character.
7522         Reverse the sign of the DU offset produced by ScriptPlace.
7524 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
7526         * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7528 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
7530         Avoid direct writes to contents member of struct Lisp_Vector.
7531         * lisp.h (vcopy): New function to copy data into vector.
7532         * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7533         * fns.c (Ffillarray): Use ASET.
7534         * keyboard.c (timer_check_2): Use AREF and ASET.
7535         (append_tool_bar_item, Frecent_keys): Use vcopy.
7536         * lread.c (read_vector): Use ASET.
7537         * msdos.c (Frecent_doskeys): Use vcopy.
7538         * xface.c (Finternal_copy_lisp_face): Use vcopy.
7539         (Finternal_merge_in_global_face): Use ASET and vcopy.
7540         * xfont.c (xfont_list_pattern): Likewise.
7542 2012-08-21  Martin Rudalics  <rudalics@gmx.at>
7544         * window.c (Fwindow_point): For the selected window always return
7545         the position of its buffer's point.
7546         (Fset_window_point): For the selected window always go in its
7547         buffer to the specified position.
7549 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
7551         Setter macros for fontsets.
7552         * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7553         (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7554         (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7555         Adjust users.
7557 2012-08-20  Glenn Morris  <rgm@gnu.org>
7559         * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7560         Don't assume that `ln -f' works.
7562 2012-08-20  Eli Zaretskii  <eliz@gnu.org>
7564         * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7565         and later about non-assignments with no effect.  See discussion at
7566         http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7567         details.
7569 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
7571         Inline setter functions for Lisp_Objects slots of struct specbinding.
7572         * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7573         Adjust users.
7575 2012-08-20  Martin Rudalics  <rudalics@gmx.at>
7577         * window.c (select_window): Always make selected window's buffer
7578         current.
7580 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
7582         Use AREF and ASET for docstrings of category tables.
7583         * category.h (CATEGORY_DOCSTRING): Use AREF.
7584         (SET_CATEGORY_DOCSTRING): Use ASET.
7585         * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7587 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
7589         Inline setter functions for hash table members.
7590         * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7591         (set_hash_hash, set_hash_index): Rename with _slot suffix.
7592         (set_hash_key_and_value, set_hash_index, set_hash_next)
7593         (set_hash_hash): New functions.
7594         * charset.c, fns.c: Adjust users.
7596 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
7598         Inline getter and setter functions for per-buffer values.
7599         * buffer.h (per_buffer_default, set_per_buffer_default)
7600         (per_buffer_value, set_per_buffer_value): New functions.
7601         (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7602         * buffer.c, data.c: Adjust users.
7604 2012-08-20  Juanma Barranquero  <lekktu@gmail.com>
7606         * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7608 2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
7610         Rely on <config.h> + <unistd.h> to declare 'environ',
7611         as gnulib does this if the system doesn't.
7612         * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
7613         Remove declaration.  MS-Windows declares it on stdlib.h which is
7614         included by conf_post.h.
7615         * emacs.c (environ) [DOUG_LEA_MALLOC]:
7616         * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7617         * vm-limit.c: Include <unistd.h>, for 'environ'.
7619         * unexaix.c, unexcoff.c: Include "mem-limits.h".
7620         (start_of_data): Remove decl; mem-limits.h provides it.
7622         * xdisp.c (handle_invisible_prop): Make it a bit faster
7623         and avoid a gcc -Wmaybe-uninitialized diagnostic.
7625 2012-08-19  Chong Yidong  <cyd@gnu.org>
7627         * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7628         ends (Bug#3874).
7630 2012-08-19  Andreas Schwab  <schwab@linux-m68k.org>
7632         * .gdbinit: Use call instead of set when calling a function in the
7633         inferior.
7635         * data.c (set_internal): Don't use set_blv_found.
7636         (Fkill_local_variable): Likewise.
7638 2012-08-18  Alp Aker  <alp.tekin.aker@gmail.com>
7640         * nsfont.m (ns_ascii_average_width): Ensure the string
7641         ascii_printable is initialized with a null-terminated character
7642         array.  Otherwise, it can contain undesired extra characters.
7644 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
7646         port new setting code to Sun C 5.8 2005/10/13
7647         * chartab.c, lisp.h (char_table_set, char_table_set_range):
7648         Return void, not Lisp_Object.  Otherwise, the compiler
7649         complains about (A?B:C) where B is void and C is Lisp_Object
7650         when compiling CHAR_TABLE_SET, due to the recent change to
7651         the API of sub_char_table_set_contents.
7653 2012-08-18  Chong Yidong  <cyd@gnu.org>
7655         * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7656         for the string case (Bug#3874).
7658 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
7660         * buffer.h (BSET): Remove (Bug#12215).
7661         Replace all uses with calls to new setter functions.
7662         (bset_bidi_paragraph_direction, bset_case_canon_table)
7663         (bset_case_eqv_table, bset_directory, bset_display_count)
7664         (bset_display_time, bset_downcase_table)
7665         (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7666         (bset_last_selected_window, bset_local_var_alist)
7667         (bset_mark_active, bset_point_before_scroll, bset_read_only)
7668         (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7669         (bset_width_table):
7670         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7671         (bset_auto_fill_function, bset_auto_save_file_format)
7672         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7673         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7674         (bset_cache_long_line_scans, bset_case_fold_search)
7675         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7676         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7677         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7678         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7679         (bset_header_line_format, bset_indicate_buffer_boundaries)
7680         (bset_indicate_empty_lines, bset_invisibility_spec)
7681         (bset_left_fringe_width, bset_major_mode, bset_mark)
7682         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7683         (bset_name, bset_overwrite_mode, bset_pt_marker)
7684         (bset_right_fringe_width, bset_save_length)
7685         (bset_scroll_bar_width, bset_scroll_down_aggressively)
7686         (bset_scroll_up_aggressively, bset_selective_display)
7687         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7688         (bset_word_wrap, bset_zv_marker):
7689         * category.c (bset_category_table):
7690         * syntax.c (bset_syntax_table):
7691         New setter functions.
7693         * process.h (PSET): Remove (Bug#12215).
7694         Replace all uses with calls to new setter functions.
7695         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7696         (PROCESS_INLINE): New macro.
7697         (pset_childp): New setter function.
7698         (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7699         * process.c (PROCESS_INLINE):
7700         Define to EXTERN_INLINE, so that the corresponding functions
7701         are compiled into code.
7702         (pset_buffer, pset_command, pset_decode_coding_system)
7703         (pset_decoding_buf, pset_encode_coding_system)
7704         (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7705         (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7706         (pset_type, pset_write_queue): New setter functions.
7708         * window.h (WSET): Remove (Bug#12215).
7709         Replace all uses with calls to new setter functions.
7710         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7711         (WINDOW_INLINE): New macro.
7712         (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7713         (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7714         (wset_total_lines, wset_vertical_scroll_bar)
7715         (wset_window_end_pos, wset_window_end_valid)
7716         (wset_window_end_vpos): New setter functions.
7717         * window.c (WINDOW_INLINE):
7718         Define to EXTERN_INLINE, so that the corresponding functions
7719         are compiled into code.
7720         (wset_combination_limit, wset_dedicated, wset_display_table)
7721         (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7722         (wset_new_normal, wset_new_total, wset_next_buffers)
7723         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7724         (wset_prev_buffers, wset_right_fringe_width)
7725         (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7726         (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7727         (wset_window_parameters):
7728         * xdisp.c (wset_base_line_number, wset_base_line_pos)
7729         (wset_column_number_displayed, wset_region_showing):
7730         New setter functions.
7732         * termhooks.h (TSET): Remove (Bug#12215).
7733         Replace all uses with calls to new setter functions.
7734         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7735         (TERMHOOKS_INLINE): New macro.
7736         (tset_charset_list, tset_selection_alist): New setter functions.
7737         * terminal.c (TERMHOOKS_INLINE):
7738         Define to EXTERN_INLINE, so that the corresponding functions
7739         are compiled into code.
7740         (tset_param_alist): New setter function.
7742 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
7744         * keyboard.h (KSET): Remove (Bug#12215).
7745         Replace all uses with calls to new setter functions.
7746         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7747         (KEYBOARD_INLINE): New macro.
7748         (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7749         (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7750         (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7751         New setter functions.
7752         * keyboard.c (KEYBOARD_INLINE):
7753         Define to EXTERN_INLINE, so that the corresponding functions
7754         are compiled into code.
7755         (kset_echo_string, kset_kbd_queue)
7756         (kset_keyboard_translate_table, kset_last_prefix_arg)
7757         (kset_last_repeatable_command, kset_local_function_key_map)
7758         (kset_overriding_terminal_local_map, kset_real_last_command)
7759         (kset_system_key_syms): New setter functions.
7761         * frame.h (FSET): Remove (Bug#12215).
7762         Replace all uses with calls to new setter functions.
7763         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7764         (FRAME_INLINE): New macro.
7765         (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7766         (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7767         (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7768         (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7769         (fset_param_alist, fset_root_window, fset_scroll_bars)
7770         (fset_selected_window, fset_title, fset_tool_bar_items)
7771         (fset_tool_bar_position, fset_tool_bar_window): New functions.
7772         * frame.c (FRAME_INLINE):
7773         Define to EXTERN_INLINE, so that the corresponding functions
7774         are compiled into code.
7775         (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7777         A few more naming-convention fixes for getters and setters.
7778         * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7779         and rename from buffer_overlays_set_before.
7780         (set_buffer_overlays_after): Move here from buffer.h, and rename
7781         from buffer_overlays_set_after.
7782         * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7783         All uses changed.
7784         (set_buffer_intervals): Rename from buffer_set_intervals.
7785         * intervals.c (set_interval_object): Move here from intervals.h,
7786         and rename from interval_set_object.
7787         (set_interval_left): Move here from intervals.h, and rename from
7788         interval_set_left.
7789         (set_interval_right): Move here from intervals.h, and rename from
7790         interval_set_right.
7791         (copy_interval_parent): Move here from intervals.h, and rename from
7792         interval_copy_parent.
7793         * intervals.h (set_interval_parent): Rename from interval_set_parent.
7794         (set_interval_plist): Rename from interval_set_plist.
7795         Return void, not Lisp_Object, since no caller uses the result.
7796         * lisp.h (string_intervals): Rename from string_get_intervals.
7797         (set_string_intervals): Rename from string_set_intervals.
7799         * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7800         (set_char_table_contents): Rename from char_table_set_contents.
7801         (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
7802         All uses changed.  See the end of
7803         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7805         * lisp.h (CSET): Remove (Bug#12215).
7806         (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7807         (set_char_table_purpose): New functions,
7808         replacing CSET.  All uses changed.  For example, replace
7809         "CSET (XCHAR_TABLE (char_table), parent, parent);" with
7810         "set_char_table_parent (char_table, parent);".
7811         The old version was confusing because it used the same name
7812         'parent' for two different things.
7814 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
7816         Functions to get and set Lisp_Object fields of buffer-local variables.
7817         * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7818         (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7819         (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7820         * data.c, eval.c, frame.c: Adjust users.
7822 2012-08-17  Chong Yidong  <cyd@gnu.org>
7824         * xfaces.c (merge_face_vectors): If the target font specfies a
7825         font spec, make the font's attributes take precedence over
7826         directly-specified attributes.
7827         (merge_face_ref): Recognize :font.
7829 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
7831         Do not use memcpy for copying intervals.
7832         * intervals.c (reproduce_interval): New function.
7833         (reproduce_tree, reproduce_tree_obj): Use it.
7834         (reproduce_tree_obj): Remove prototype.
7836 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
7838         * lisp.h (duration_to_sec_usec): Remove unused decl.
7840 2012-08-17  Alp Aker  <alp.tekin.aker@gmail.com>
7842         * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7843         to an allocated instance of NSString, not to the class itself.
7845 2012-08-17  Juanma Barranquero  <lekktu@gmail.com>
7847         * makefile.w32-in (C_CTYPE_H): New macro.
7848         (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7849         ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7850         ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7852 2012-08-16  Paul Eggert  <eggert@cs.ucla.edu>
7854         Use ASCII tests for character types.
7855         * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7856         * xfns.c, xterm.c:
7857         Don't include <ctype.h>; was not needed.
7858         * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7859         * sysdep.c, xfaces.c:
7860         Include <c-ctype.h> instead of <ctype.h>.
7861         * nsterm.m: Include <c-ctype.h>.
7862         * charset.c (read_hex):
7863         * doc.c (Fsnarf_documentation):
7864         * fileio.c (IS_DRIVE) [WINDOWSNT]:
7865         (DRIVE_LETTER) [DOS_NT]:
7866         (Ffile_name_directory, Fexpand_file_name)
7867         (Fsubstitute_in_file_name):
7868         * font.c (font_parse_xlfd, font_parse_fcname):
7869         * frame.c (x_set_font_backend):
7870         * gtkutil.c (xg_get_font):
7871         * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7872         * nsimage.m (hexchar):
7873         * nsterm.m (ns_xlfd_to_fontname):
7874         * sysdep.c (system_process_attributes):
7875         * xfaces.c (hash_string_case_insensitive):
7876         Use C-locale tests instead of locale-specific tests for character
7877         types, since we want the ASCII interpretation here, not the
7878         interpretation suitable for whatever happens to be the current locale.
7880 2012-08-16  Martin Rudalics  <rudalics@gmx.at>
7882         Consistently check windows for validity/liveness
7883         (Bug#11984, Bug#12025, Bug#12026).
7884         * lisp.h (CHECK_VALID_WINDOW): New macro.
7885         * window.c (decode_window): Rename to decode_live_window.
7886         (decode_valid_window, Fwindow_valid_p): New functions.
7887         (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7888         (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7889         (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7890         (Fwindow_prev_sibling, Fwindow_combination_limit)
7891         (Fset_window_combination_limit, Fwindow_use_time)
7892         (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7893         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7894         (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7895         (Fwindow_hscroll, Fset_window_hscroll)
7896         (Fwindow_redisplay_end_trigger)
7897         (Fset_window_redisplay_end_trigger, Fwindow_edges)
7898         (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7899         (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7900         (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7901         (Fwindow_end, Fset_window_point, Fset_window_start)
7902         (Fpos_visible_in_window_p, Fwindow_line_height)
7903         (Fwindow_dedicated_p, Fset_window_dedicated_p)
7904         (Fwindow_prev_buffers, Fset_window_prev_buffers)
7905         (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7906         (Fset_window_parameter, Fwindow_display_table)
7907         (Fset_window_display_table, Fdelete_other_windows_internal)
7908         (Fset_window_buffer, Fset_window_new_total)
7909         (Fset_window_new_normal, Fdelete_window_internal)
7910         (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7911         (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7912         (Fwindow_scroll_bars): Check whether argument window is a valid or
7913         live window.  Update doc-strings.
7914         (syms_of_window): New symbol Qwindow_valid_p.
7915         * keyboard.c (Fposn_at_x_y): Check whether argument
7916         frame_or_window denotes a valid window.
7918 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
7920         Fix previous char table change.
7921         * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7922         * chartab.c (optimize_sub_char_table): Likewise.
7924 2012-08-16  Chong Yidong  <cyd@gnu.org>
7926         * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7928         * xfont.c (xfont_open):
7929         * xftfont.c (xftfont_open): Set the font's max_width field.
7931         * nsfont.m (nsfont_open): Similar to the Xft backend, set
7932         min_width to space_width and average_width to the average over
7933         printable ASCII characters.
7934         (ns_char_width): Code cleanup.
7935         (ns_ascii_average_width): New utility function.
7937         * font.h (struct font): Update comments.
7939 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
7941         Simple interface to set Lisp_Object fields of character tables.
7942         * lisp.h (CSET): New macro.
7943         (char_table_set_extras, char_table_set_contents)
7944         (sub_char_table_set_contents): New function.
7945         * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7946         * syntax.c: Adjust users.
7948 2012-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
7950         * eval.c (eval_sub): Bind lexical-binding.
7951         * lread.c (Qlexical_binding): Make non-static.
7953 2012-08-15  Jan Djärv  <jan.h.d@swipnet.se>
7955         * nsmenu.m (popupSession): Remove.
7956         (pop_down_menu): Remove endModalSession.
7957         (timeout_handler:): New method.
7958         (runDialogAt:): Get next timeout.  Start a NSTimer with that timeout.
7959         Call runModalForWindow.  Check timer_fired when it returns.
7960         If not set, cancel timer and break out of loop.
7961         Otherwise loop again, with a new timeout.
7963         * nsterm.m: Include fcntl.h if present.
7964         (fd_entry, t_readfds, inNsSelect): Remove.
7965         (select_writefds, select_valid, select_timeout, selfds)
7966         (select_mutex, apploopnr): Add.
7967         (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7968         Otherwise call kbd_buffer_store_event.
7969         (ns_send_appdefined): Remove release of fd_entry.
7970         (ns_read_socket): Always send appdefined.  Remove inNsSelect check.
7971         Increment and decrement apploopnr.
7972         (ns_select): If no file descriptors, just do a NSTimer.
7973         Otherwise copy read/write masks and start select thread (fd_handler).
7974         Start main loop and wait for application defined event.
7975         Inform select thread to stop selecting after main loop is exited.
7976         (ns_term_init): Create selfds pipe and set non-blocking.
7977         Initialize select_mutex.  Start the select thread (fd_handler).
7978         (fd_handler:): Loop forever, wait for info from the main thread
7979         to either start or stop selecting.  When select returns, send
7980         and appdefined event.
7981         (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7982         If not call kbd_buffer_store_event.
7984         * nsterm.h (EmacsApp): fd_handler takes id argument.
7985         (EmacsDialogPanel): Add timer_fired and timeout_handler.
7987         * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7989 2012-08-15  Eli Zaretskii  <eliz@gnu.org>
7991         * region-cache.c (move_cache_gap): Update gap_len using the actual
7992         growth of the boundaries array.  Do not change cache_len.
7993         (Bug#12196)
7995 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
7997         Generalize and cleanup font subsystem checks.
7998         * font.h (FONT_DEBUG, font_assert): Remove.
7999         * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8000         Change font_assert to eassert.  Use eassert where appropriate.
8002 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
8004         * gtkutil.c (xg_get_font): Use pango_units_to_double.
8006 2012-08-15  Chong Yidong  <cyd@gnu.org>
8008         * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8009         When using the new font chooser, use gtk_font_chooser_get_font_desc to
8010         extract the font descriptor instead of just the font name.
8011         In that case, return a font spec instead of a string.
8012         (x_last_font_name): Move to this file from xfns.c.
8014         * xfns.c (Fx_select_font): The return value can also be a font
8015         spec.  Move x_last_font_name management to gtkutil.c.
8017         * xfaces.c: Make font weight and style symbols non-static.
8019 2012-08-15  Stefan Monnier  <monnier@iro.umontreal.ca>
8021         * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8022         (bug#12117).
8024 2012-08-14  Stefan Monnier  <monnier@iro.umontreal.ca>
8026         * alloc.c (Fgarbage_collect): Use plural form consistently.
8028 2012-08-14  Eli Zaretskii  <eliz@gnu.org>
8030         * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8031         iteration through the command loop.  Fixes a problem whereby mouse
8032         movements are ignored until the first mouse click.
8034 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
8036         Use bool, not int, for Lisp booleans.
8037         This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8038         makes Emacs a bit smaller and presumably a bit faster.
8039         * lisp.h: Include <stdbool.h>.
8040         (struct Lisp_Boolfwd, defvar_bool):
8041         * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8042         * regex.c [!emacs]: Include <stdbool.h>.
8043         (false, true): Remove; <stdbool.h> does this for us now.
8045 2012-08-14  Chong Yidong  <cyd@gnu.org>
8047         * character.c (Fcharacterp): Doc fix (Bug#12076).
8049         * data.c (Findirect_variable): Doc fix (Bug#11040).
8051         * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8053         * editfns.c (Fformat): Doc fix (Bug#12059).
8054         (Fsave_current_buffer): Doc fix (Bug#11542).
8056 2012-08-14  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
8058         * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8059         (bug#12022).
8061 2012-08-14  Martin Rudalics  <rudalics@gmx.at>
8063         * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8064         (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8065         * minibuf.c (choose_minibuf_frame, read_minibuf):
8066         * w32fns.c (x_create_tip_frame):
8067         * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8068         Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8070 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
8072         * intervals.c (offset_intervals): Remove obsolete comment.
8074 2012-08-14  Andreas Schwab  <schwab@linux-m68k.org>
8076         * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8078 2012-08-14  Gergely Risko  <gergely@risko.hu>
8080         * coding.c (decode_coding): Record buffer modification before
8081         disabling undo_list (Bug#11773).
8083 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
8085         Revert and cleanup some recent overlay changes.
8086         * buffer.h (enum overlay_type): Remove.
8087         (buffer_get_overlays, buffer_set_overlays): Likewise.
8088         (buffer_set_overlays_before, buffer_set_overlays_after):
8089         New function.  Adjust users.
8090         (unchain_both): Add eassert.
8092 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
8094         * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8096 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
8098         * gtkutil.c (xg_mark_data): Don't assume C99.
8100 2012-08-13  Jan Djärv  <jan.h.d@swipnet.se>
8102         * gtkutil.c (xg_frame_tb_info): New struct.
8103         (TB_INFO_KEY): New define.
8104         (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8105         (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8106         (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8107         if not present.
8108         (update_frame_tool_bar): Return early if data in xg_frame_tb_info
8109         is up to date.  Otherwise store new data.
8110         (free_frame_tool_bar): Free xg_frame_tb_info if present.
8112 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
8114         Use KSET for write access to Lisp_Object members of struct kboard.
8115         * keyboard.h (KSET): New macro.
8116         * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8117         * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8118         * xterm.c: Adjust users.
8120 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
8122         Use BSET for write access to Lisp_Object members of struct buffer.
8123         * buffer.h (BSET): New macro.
8124         * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8125         * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8126         * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8127         * window.c, xdisp.c, xfns.c: Adjust users.
8129 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
8131         * lread.c (syms_of_lread): Initialize Vlexical_binding.
8133 2012-08-11  Jan Djärv  <jan.h.d@swipnet.se>
8135         * nsterm.m (not_in_argv): New function.
8136         (application:openFile, application:openTempFile:):
8137         (application:openFileWithoutUI:, application:openFiles:): Open file
8138         if not_in_argv returns non-zero (bug#12171).
8140         * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
8141         (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8142         Define for Gtk+ versions less than 3.2.
8143         (xg_get_font_name): Use those functions/macros here.
8144         Reported by Frans Oilinki <moilinki@gmail.com>.
8146 2012-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
8148         * unexmacosx.c (copy_data_segment): Copy initialized data in
8149         statically linked libraries from input file rather than memory.
8151         * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8152         LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8153         (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8155 2012-08-10  Glenn Morris  <rgm@gnu.org>
8157         * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8158         * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8160 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
8162         Fix last change to allow compilation with low optimization levels.
8163         * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8164         Reported by Jan Djärv <jan.h.d@swipnet.se>.
8166 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
8168         Use common inline syntax in intervals.h.
8169         * intervals.h (INTERVALS_INLINE): New macro.
8170         Change all users from LISP_INLINE.
8172 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
8174         Define Qnone once for all platforms.
8175         * frame.c (Qnone): Define here.
8176         (syms_of_frame): DEFSYM it.
8177         * lisp.h (Qnone): New declaration.
8178         * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8179         * xfns.c: Remove duplication.  Adjust users.
8181 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
8183         Remove unused macros from intervals.h.
8184         * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8185         * intervals.c: Adjust comment.
8187 2012-08-10  Eli Zaretskii  <eliz@gnu.org>
8189         * w32fns.c <w32_unicode_gui>: New static variable.
8190         (globals_of_w32fns): Initialize it according to os_subtype.
8191         (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8192         testing os_subtype.
8194 2012-08-10  Joakim Hårsman  <joakim.harsman@gmail.com>  (tiny change)
8195             Eli Zaretskii  <eliz@gnu.org>
8197         Fix bug #10299 with Unicode characters sent by customized
8198         keyboards created by MSKLC.
8199         * w32fns.c (INIT_WINDOW_CLASS): New macro.
8200         (w32_init_class): Use it to initialize the Emacs class with either
8201         ANSI or Unicode API calls.
8202         (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8203         later.
8204         (w32_wnd_proc): If the character code sent by WM_CHAR or
8205         WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8206         original message.  Call DefWindowProcW on NT and later.
8208 2012-08-10  Glenn Morris  <rgm@gnu.org>
8210         * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8212         * lisp.h (DIRECTORY_SEP): Let configure set it.
8214 2012-08-09  Dmitry Antipov  <dmantipov@yandex.ru>
8216         Use TSET for write access to Lisp_Object slots of struct terminal.
8217         * termhooks.h (TSET): New macro.
8218         * coding.c, terminal.c, xselect.c: Adjust users.
8220 2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
8222         * xdisp.c (safe_eval_handler): Remove prototype.  Receive args describing
8223         the failing expression, include them in the error message.
8224         * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8225         * lisp.h (internal_condition_case_n): Update declaration.
8227 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
8229         Inline functions to examine and change buffer overlays.
8230         * buffer.c (unchain_both): New function.
8231         * buffer.h (buffer_get_overlays, buffer_set_overlays):
8232         (buffer_has_overlays): New function.
8233         (enum overlay_type): New enum.
8234         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8235         * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8237 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
8239         Inline functions to examine and change buffer intervals.
8240         * alloc.c (mark_interval_tree): Remove.
8241         (MARK_INTERVAL_TREE): Simplify.
8242         (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
8243         * intervals.c (buffer_balance_intervals): New function.
8244         (graft_intervals_into_buffer): Adjust indentation.
8245         (set_intervals_multibyte): Simplify.
8246         * buffer.h (BUF_INTERVALS): Remove.
8247         (buffer_get_intervals, buffer_set_intervals): New function.
8248         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8249         * intervals.c, textprop.c: Adjust users.
8251 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
8253         Inline functions to examine and change string intervals.
8254         * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8255         (string_get_intervals, string_set_intervals): New function.
8256         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8257         * lread.c, print.c, textprop.c: Adjust users.
8259 2012-08-08  Glenn Morris  <rgm@gnu.org>
8261         * lisp.mk (lisp): Remove language/persian.elc.
8263 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
8265         Cleanup intervals.
8266         * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8267         (NULL_INTERVAL_P): Likewise.  Adjust users.
8268         (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8269         Adjust comment.  Move under #if 0.
8270         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8271         * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8273 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
8275         Check total length of intervals with eassert.
8276         * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8277         * intervals.c: Change all users to eassert.
8279 2012-08-07  Eli Zaretskii  <eliz@gnu.org>
8281         * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8282         Rename fields to match removal of FGET and WGET and disuse of
8283         INTERNAL_FIELD in Lisp_Cons.
8285 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
8287         Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8288         * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8289         name since all xname users are fixed long time ago.  Do not
8290         use INTERNAL_FIELD.
8291         (set_symbol_name, set_symbol_function, set_symbol_plist):
8292         (set_symbol_next, set_overlay_plist): New function.
8293         (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8294         (struct Lisp_Overlay): Likewise.
8295         (CVAR, MVAR, SVAR): Remove.
8296         * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8297         * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8298         * xterm.c: Adjust users.
8299         * .gdbinit: Change to use name field of struct Lisp_Symbol
8300         where appropriate.
8302 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
8304         Basic functions to set Lisp_Object and pointer slots of intervals.
8305         * intervals.h (interval_set_parent, interval_set_object):
8306         (interval_set_left, interval_set_right, interval_set_plist):
8307         (interval_copy_parent): New function.
8308         (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
8309         (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8310         Adjust indentation.
8311         (INTERVAL_SIZE): Remove.  Adjust users.
8312         * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8314 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
8316         Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8317         * process.h (PGET): Remove.
8318         (struct Lisp_Process): Do not use INTERNAL_FIELD.
8319         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8321 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
8323         Drop WGET and revert read access to Lisp_Objects slots of struct window.
8324         * window.h (WGET): Remove.
8325         (struct window): Do not use INTERNAL_FIELD.
8326         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8327         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8328         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8329         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8330         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8331         Adjust users.
8333 2012-08-07  Chong Yidong  <cyd@gnu.org>
8335         * window.c (Fwindow_edges, Fwindow_pixel_edges)
8336         (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8337         (Fdelete_window_internal): Signal an error if the window is not on
8338         a live frame (Bug#12025).
8340 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
8342         Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8343         * frame.h (FGET): Remove.
8344         (struct frame): Do not use INTERNAL_FIELD.
8345         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8346         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8347         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8348         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8350 2012-08-06  Juanma Barranquero  <lekktu@gmail.com>
8352         * w32.c: Silence compiler warnings.
8353         (map_w32_filename): Remove unused variable `is_fat'.
8354         (chase_symlinks): Add parentheses around expression.
8356 2012-08-06  Glenn Morris  <rgm@gnu.org>
8358         * sysdep.c: Respect BROKEN_GETWD.
8360         * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8361         Let configure handle it.
8362         (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8364 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8366         Use GCALIGNMENT where appropriate.
8367         * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8368         (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8369         (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8371 2012-08-06  Eli Zaretskii  <eliz@gnu.org>
8373         * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8374         Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
8376 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
8378         * buffer.h (struct buffer): Revert `indirections' to a simple int;
8379         that should be sufficient for everyone.
8381 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
8383         * keyboard.c (timer_check_2): Add break so timer_check returns next
8384         timeout.
8386 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8388         Fix Windows build errors introduced after converting to WGET and WSET.
8389         * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8390         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8392 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
8394         * nsterm.m (ns_frame_rehighlight): Use FSET.
8396         * nsmenu.m (ns_update_menubar): Use FSET.
8398 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8400         Separate read and write access to Lisp_Object slots of Lisp_Process.
8401         * process.h (PGET, PSET): New macros similar to AREF and ASET.
8402         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8404 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8406         Separate read and write access to Lisp_Object slots of struct window.
8407         * window.h (WGET, WSET): New macros similar to AREF and ASET.
8408         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8409         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8410         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8411         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8412         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8413         Adjust users.
8415 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8417         Fix Windows build errors introduced after converting to FGET and FSET.
8418         * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8419         (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8420         (w32_judge_scroll_bars): Change to use FSET.
8421         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8423 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8425         Fix replacement typo.
8426         * window.c (replace_window): Set root_window instead of
8427         selected_window.  This fixes a total window subsystem
8428         malfunction reported by Bastien Guerry <bzg@gnu.org>.
8430 2012-08-06  Glenn Morris  <rgm@gnu.org>
8432         * lisp.mk (lisp): Add language/persian.elc.
8434 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8436         Separate read and write access to Lisp_Object slots of struct frame.
8437         * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8438         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8439         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8440         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8441         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8443 2012-08-05  Andreas Schwab  <schwab@linux-m68k.org>
8445         * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8447 2012-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
8449         Generalize common compile-time constants.
8450         * lisp.h (header_size, bool_header_size, word_size): Now here.
8451         (struct Lisp_Vector): Add comment.
8452         (struct Lisp_Bool_Vector): Move up to define handy constants.
8453         (VECSIZE, PSEUDOVECSIZE): Simplify.
8454         (SAFE_ALLOCA_LISP): Use new constant.  Adjust indentation.
8455         * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8456         * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8457         * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8458         * xfont.c, xmenu.c: Use word_size where appropriate.
8460 2012-08-05  Lawrence Mitchell  <wence@gmx.li>
8462         * search.c (Freplace_match): Treat \? in the replacement text
8463         literally (Bug#8161).
8465 2012-08-05  Chong Yidong  <cyd@gnu.org>
8467         * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8468         * frame.c (Vdelete_frame_functions):
8469         * emacs.c (Vkill_emacs_hook): Doc fix.
8471 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
8473         * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8474         --with-x-toolkit=no builds.
8475         Reported by Carsten Mattner <carstenmattner@gmail.com>.
8477 2012-08-04  Chong Yidong  <cyd@gnu.org>
8479         * syntax.c (Fmodify_syntax_entry): Doc fix.
8481 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
8483         Fix startup warnings about ../site-lisp on MS-Windows.  (Bug#11959)
8484         * w32.c (init_environment): Change the default values of many
8485         environment variables in dflt_envvars[] to NULL, to avoid pushing
8486         them into environment when they were not already defined.
8487         Remove the code that deletes site-lisp subdirectories from the default
8488         value of EMACSLOADPATH, as it is no longer needed.
8489         (check_windows_init_file): Now external, not static.
8490         Use Vload_path as is, without adding anything, as this function is now
8491         called when Vload_path is already set up.
8493         * w32.h (check_windows_init_file): Add prototype.
8495         * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8496         directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8497         compatibility with Posix platforms.
8498         (main): Move the call to check_windows_init_file to here from
8499         w32.c.
8500         (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8501         any, in the DEFALT argument into the root of the Emacs build or
8502         installation tree, as appropriate.
8504         * callproc.c (init_callproc_1): Call decode_env_path instead of
8505         doing its equivalent by hand.
8506         (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8507         the code that sets Vexec_path run on MS-Windows.
8509         * lread.c (init_lread): Add comments to #ifdef's.
8511         * msdos.c (dos_set_window_size, IT_update_begin)
8512         (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8513         instead of direct references.
8515 2012-08-04  Paul Eggert  <eggert@cs.ucla.edu>
8517         Export DEFAULT_REHASH_* to GDB.
8518         * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8519         Now constants, not macros.
8521 2012-08-03  Paul Eggert  <eggert@cs.ucla.edu>
8523         Remove unnecessary casts involving pointers.
8524         These casts are no longer needed now that we assume C89 or later,
8525         since they involve casting to or from void *.
8526         * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8527         (make_pure_float, make_pure_vector):
8528         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8529         * macros.c (Fstart_kbd_macro):
8530         * menu.c (find_and_return_menu_selection):
8531         * minibuf.c (read_minibuf_noninteractive):
8532         * sysdep.c (closedir):
8533         * xdisp.c (x_produce_glyphs):
8534         * xfaces.c (compare_fonts_by_sort_order):
8535         * xfns.c (x_real_positions, select_visual):
8536         * xselect.c (x_stop_queuing_selection_requests)
8537         (x_get_window_property, x_get_window_property_as_lisp_data):
8538         * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8539         Remove unnecessary pointer casts.
8540         * alloc.c (record_xmalloc): New function.
8541         * lisp.h (record_xmalloc): New decl.
8542         (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8543         more like a function.  This is because the pointer cast is not
8544         needed.  All uses changed.
8545         * print.c (print_string, print_error_message): Avoid length recalc.
8547         Improve fix for macroexp crash with debugging (Bug#12118).
8548         * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8549         ARRAY_MARK_FLAG when checking subscripts, because ASET is
8550         not supposed to be invoked from the garbage collector.
8551         See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8552         (gc_aset): New function, which is like ASET but can be
8553         used in the garbage collector.
8554         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8555         (set_hash_index): Use it instead of ASET.
8557 2012-08-03  Eli Zaretskii  <eliz@gnu.org>
8559         Support symlinks on latest versions of MS-Windows.
8560         * w32.c: Include winioctl.h and aclapi.h.
8561         (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8562         (revert_to_self): Forward declarations of static functions.
8563         <static BOOL g_b_init_get_security_info>:
8564         <g_b_init_create_symbolic_link>: New static flags.
8565         (globals_of_w32): Initialize them to zero.
8566         (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8567         (map_w32_filename): Improve commentary.  Simplify switch.
8568         (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8569         headers (most versions of MinGW w32api don't).
8570         (get_security_info, create_symbolic_link)
8571         (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8572         New functions.
8573         (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8574         in the argument file name.
8575         (sys_access): Call unc_volume_file_attributes only if
8576         GetFileAttributes fails with network-related error codes.
8577         (sys_rename): Diagnose renaming of a symlink when the user doesn't
8578         have the required privileges.
8579         (get_file_security_desc_by_name): Rename from
8580         get_file_security_desc.
8581         (stat_worker): New function, with most of the guts of 'stat', and
8582         with addition of handling of symlinks and support for 'lstat'.
8583         If possible, get file's attributes and security information by
8584         handle, not by name.  Produce S_IFLNK bit for symlinks, when
8585         called from 'lstat'.
8586         (stat, lstat): New functions, call 'stat_worker'.
8587         (symlink, readlink, careadlinkat): Rewritten to create and resolve
8588         symlinks when the underlying filesystem supports them.
8590 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
8592         Fix macroexp crash on Windows with debugging (Bug#12118).
8593         * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8594         checking subscripts; problem introduced with the recent
8595         "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8596         (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8597         since it's used in non-static inline functions now.
8599         * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8600         Don't assume buffer size fits in 'int'.  Remove unused local.
8602         Use C99-style 'extern inline' if available.
8603         * buffer.h (BUFFER_INLINE):
8604         * category.h (CATEGORY_INLINE):
8605         * character.h (CHARACTER_INLINE):
8606         * charset.h (CHARSET_INLINE):
8607         * composite.h (COMPOSITE_INLINE):
8608         * dispextern.h (DISPEXTERN_INLINE):
8609         * lisp.h (LISP_INLINE):
8610         * systime.h (SYSTIME_INLINE):
8611         New macro, replacing 'static inline' in this header.
8612         * buffer.h, category.h, character.h, charset.h, composite.h:
8613         * dispextern.h, lisp.h, systime.h:
8614         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8615         * alloc.c (LISP_INLINE):
8616         * buffer.c (BUFFER_INLINE):
8617         * category.c (CATEGORY_INLINE):
8618         * character.c (CHARACTER_INLINE):
8619         * charset.c (CHARSET_INLINE):
8620         * composite.c (COMPOSITE_INLINE):
8621         * dispnew.c (DISPEXTERN_INLINE):
8622         * sysdep.c (SYSTIME_INLINE):
8623         Define to EXTERN_INLINE, so that the corresponding functions
8624         are compiled into code.
8625         * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8626         (INLINE_HEADER_END): New macros.
8627         * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8628         since it's used in non-static inline functions now.
8629         (VALMASK) [!USE_LSB_TAG]: Likewise.
8631 2012-08-02  Glenn Morris  <rgm@gnu.org>
8633         * s/: Remove empty directory.
8635         * s/ms-w32.h: Move to ../nt/inc.
8636         * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8637         Update for new ms-w32.h location.
8639 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
8641         Port to Solaris 8.
8642         * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8644 2012-08-02  Glenn Morris  <rgm@gnu.org>
8646         * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8647         hard-coding the path separator.
8649 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
8651         Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8652         This how ASET and AREF are supposed to work, and makes
8653         it easier to think about future improvements.  See
8654         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8655         * charset.h (set_charset_attr): New function.
8656         All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8657         * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8658         (aref_addr): New function.  All uses of &AREF(...) changed.
8659         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8660         (set_hash_index): New functions.  All lvalue-style uses of
8661         HASH_KEY etc. changed.
8662         * keyboard.c (set_prop): New function.  All lvalue-style uses
8663         of PROP changed.
8665 2012-08-01  Alp Aker  <alp.tekin.aker@gmail.com>
8667         * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8668         (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
8669         (EmacsScroller-dealloc): Adjust to use WVAR.  (Bug#12114)
8670         * nsfns.m (ns_set_name_as_filename): Likewise.
8671         * nsmenu.m (ns_update_menubar): Likewise.
8672         * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8674 2012-08-01  Eli Zaretskii  <eliz@gnu.org>
8676         * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8677         Adapt to latest changes in field names of the corresponding Lisp
8678         objects.
8680         * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8682 2012-08-01  Glenn Morris  <rgm@gnu.org>
8684         * s/msdos.h: Remove file.
8685         * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8686         * Makefile.in (S_FILE): Remove.
8687         (config_h): Remove S_FILE.
8689 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
8691         * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8692         Remove; moved to nt/config.nt.
8694 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
8696         Use INTERNAL_FIELD for conses and overlays.
8697         * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8698         Remove obsolete comment.
8699         (MVAR): New macro.
8700         (struct Lisp_Overlay): Use INTERNAL_FIELD.
8701         * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8703 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
8705         Use INTERNAL_FIELD for symbols.
8706         * lisp.h (SVAR): New macro.  Adjust users.
8707         * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8708         * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8710 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
8712         Use INTERNAL_FIELD for processes.
8713         * process.h (PVAR): New macro.  Adjust style.
8714         (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8715         * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8717 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
8719         Use INTERNAL_FIELD for windows.
8720         * window.h (WVAR): New macro.
8721         (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8722         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8723         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8724         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8725         * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8726         * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8728 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
8730         * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8732 2012-08-01  Glenn Morris  <rgm@gnu.org>
8734         * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8735         Move to configure.ac.
8737 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
8739         * makefile.w32-in (CONFIG_H): Update dependencies.
8740         (CONF_POST_H): New macro.
8742         * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8744 2012-07-31  Glenn Morris  <rgm@gnu.org>
8746         * Makefile.in (S_FILE): No longer set by configure.
8748         * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8749         is available.
8750         (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8752         * process.h (NULL_DEVICE):
8753         * emacs.c (SEPCHAR):
8754         * editfns.c (USER_FULL_NAME): Let configure set them.
8756         * s/README, s/template.h: Remove files.
8758         * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8760         * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8761         Move to configure.ac.
8763 2012-07-31  Eli Zaretskii  <eliz@gnu.org>
8765         * .gdbinit (xframe): Adapt to introduction of FVAR and the
8766         resulting renaming of 'struct frame' members.
8768         * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8770         * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8771         after introduction of FVAR.
8773 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
8775         * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8777         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8778         instead of compositeToPoint.
8779         (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8781         * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
8783 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
8785         Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8786         * lisp.h (INTERNAL_FIELD): New macro.
8787         * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
8788         (BVAR): Change to use INTERNAL_FIELD.
8789         * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8790         (KVAR): Change to use INTERNAL_FIELD.
8791         * frame.h (FVAR): New macro.
8792         (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
8793         * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8794         * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8795         * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8796         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8798 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
8800         Miscellaneous fixes for non-default X toolkits.
8801         * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8802         * xterm.c (x_frame_of_widget): Remove redundant prototype.
8803         Move under #ifdef USE_LUCID.
8804         (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8805         definition and usage to avoid warnings.
8807 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
8809         * nsterm.m (openFiles): Fix previous checkin.
8811 2012-07-31  Paul Eggert  <eggert@cs.ucla.edu>
8813         * indent.c (compute_motion): Remove unused local.
8815 2012-07-31  Glenn Morris  <rgm@gnu.org>
8817         * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8819         * conf_post.h [USG5_4]:
8820         Move remaining contents of s/usg5-4-common.h here.
8821         * s/usg5-4-common.h: Remove file.
8823         * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8824         * s/irix6-5.h: Remove file.
8826         * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8827         * s/darwin.h: Remove file.
8829         * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8830         * s/hpux10-20.h: Remove file, which is now empty.
8832 2012-07-30  Glenn Morris  <rgm@gnu.org>
8834         * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8835         * Makefile.in (config_h): Add conf_post.h.
8836         * makefile.w32-in (CONFIG_H): Add conf_post.h.
8838 2012-07-30  Jan Djärv  <jan.h.d@swipnet.se>
8840         * nsterm.m (ns_do_open_file): New variable.
8841         (ns_term_init): Set ns_do_open_file to YES after run returns.
8842         (openFile, openTempFile, openFileWithoutUI, openFiles):
8843         Open files only if ns_do_open_file.
8845 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
8847         * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
8848         This no-op macro hasn't been needed for many years.
8849         * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8851         Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8852         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8853         * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8854         gdb_make_enums_visible.
8855         (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8856         (DIRECTORY_SEP): Now a constant, not a macro.
8858 2012-07-30  Eli Zaretskii  <eliz@gnu.org>
8860         * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8861         w32_kbd_patch_key as the 2nd arg.  (Bug#12082)
8863         * w32term.c <w32_keyboard_codepage>: Renamed from
8864         keyboard_codepage and now external.  All users changed.
8866         * w32term.h: Add declaration of w32_keyboard_codepage.
8868         * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8869         the codepage to translate keys to Unicode.  If this argument is
8870         -1, use the value returned by GetConsoleCP.  All callers changed.
8872 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
8874         Update .PHONY listings in makefiles.
8875         * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8876         bootstrap-clean, distclean, maintainer-clean, versioclean,
8877         extraclean, frc.
8879         * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8880         This is a bit clearer.  Fix some commentary typos.
8882 2012-07-30  Glenn Morris  <rgm@gnu.org>
8884         * s/netbsd.h: Let configure include signal.h if needed.
8885         Remove file, which is now empty.
8887         * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8888         Let configure set them.
8889         * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8890         No more need to undefine.
8892 2012-07-30  Andreas Schwab  <schwab@linux-m68k.org>
8894         * keymap.c (Fkey_description): Don't remove 0x80 bit from
8895         non-single-byte char when adding meta modifier.  (Bug#12090)
8897 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
8899         Convert safe_call to use variable number of arguments.
8900         * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
8901         (safe_call2): Fix comment.
8902         * lisp.h (safe_call): Adjust prototype.
8903         * coding.c (encode_coding_object): Change to use safe_call2.
8904         * xfaces.c (merge_face_heights): Change to use safe_call1.
8906 2012-07-30  Glenn Morris  <rgm@gnu.org>
8908         * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
8909         does that unconditionally.  Remove file, which is now empty.
8911         * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8912         Remove empty files.
8914 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
8916         Export to GDB most of lisp.h's remaining object-like macros.
8917         * lisp.h (min, max): Move earlier, because they're used earlier now.
8918         (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8919         (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8920         (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8921         (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8922         (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8923         (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8924         (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8925         (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8926         Now constants, for GDB.  They need not be macros.
8927         (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8928         Now constants, for GDB, as well as macros, for static initializers.
8929         (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8930         Move to after the definition of struct Lisp_Char_Table,
8931         since the former now needs that type defined.
8932         (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8933         (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8934         (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8935         New enums, for gdb_make_enums_visible.
8936         (GLYPH_MODE_LINE_FACE): Remove; unused.
8937         * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
8938         (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8939         CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8940         enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8941         enum maxargs, enum MAX_ALLOCA.
8942         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8943         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8944         no longer needed, now that they are done in lisp.h.
8946 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
8948         Cleanup string bytes checking.
8949         * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove.  Convert
8950         all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8951         (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8952         (check_sblock, compact_small_strings): Simplify.
8954 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
8956         * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8957         These macros are confusing and no longer need to be defined, as
8958         the enum values now suffice.  All uses replaced with definiens.
8959         (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8961 2012-07-29  Juanma Barranquero  <lekktu@gmail.com>
8963         * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8964         ($(BLD)/w32console.$(O)): Update dependencies.
8966 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
8968         Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8969         * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8970         time.  Adjust users.
8971         (CHECK_CONS_LIST): Remove.  Convert all users to check_cons_list.
8973 2012-07-29  Jan Djärv  <jan.h.d@swipnet.se>
8975         * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8976         setting sitelisp (Bug#12010).
8978 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
8980         * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
8982         * w32heap.c (cache_system_info):
8983         * w32.c (sys_rename):
8984         * w32proc.c (find_child_console, sys_kill): All users changed.
8986 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
8988         * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8990 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
8992         * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8994 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
8996         Cleanup statistics calculation in Fgarbage_collect.
8997         * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8998         Fix zombies percentage calculation.  Simplify elapsed time calculation.
9000 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
9002         Generalize marker debugging code under MARKER_DEBUG and use eassert.
9003         * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9004         (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9005         (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9006         (replace_range, replace_range_2, del_range_2): Change to eassert.
9007         * marker.c (byte_char_debug_check): Adjust style.
9009 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
9011         Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9012         * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9013         long-ago-commented-out code that talks about "WIN32".
9014         * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9015         All uses changed.
9017 2012-07-28  Paul Eggert  <eggert@cs.ucla.edu>
9019         Use Gnulib stdalign module (Bug#9772, Bug#9960).
9020         * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9021         Simplify by using alignof.
9022         (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9023         * lisp.h: Include <stdalign.h>.
9024         (GCALIGNMENT): New macro and constant.
9025         (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
9026         (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9027         (stdalign): New macro, if not already defined.
9029 2012-07-28  Eli Zaretskii  <eliz@gnu.org>
9031         Fix non-ASCII input in non-GUI frames on MS-Windows.  (Bug#12055)
9032         * w32inevt.c: Include w32inevt.h.
9033         (w32_read_console_input): New inline function, calls either
9034         ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9035         w32_console_unicode_input.
9036         (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9037         (w32_kbd_patch_key, key_event): Use the codepage returned by
9038         GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9039         (key_event): use uChar.UnicodeChar only if
9040         w32_console_unicode_input is non-zero.
9042         * w32console.c: Include w32heap.h.
9043         <w32_console_unicode_input>: New global variable.
9044         (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9045         family of Windows, zero otherwise.
9047         * w32inevt.h: Declare w32_console_unicode_input.
9049         * xdisp.c (init_iterator): Don't reference tip_frame in a build
9050         --without-x.  (Bug#11742)
9052 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
9054         Adjust GDB to reflect pvec_type changes (Bug#12036).
9055         * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
9056         2012-07-04 changes to pseudovector representation.
9057         Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
9059 2012-07-27  Michael Albinus  <michael.albinus@gmx.de>
9061         * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9062         bus address.
9063         (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9065 2012-07-27  Eli Zaretskii  <eliz@gnu.org>
9067         * alloc.c (listn): Fix the order the arguments are consed onto the
9068         list.
9070         * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9071         enumeration constants, as PURE and HEAP are too general, and clash
9072         with other headers and sources, such as gmalloc.c and the
9073         MS-Windows system headers.  All users changed.
9075 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
9077         Revert last save_excursion_save and save_excursion_restore changes.
9078         * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9079         Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9081 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
9083         Fix recently-introduced typos in Windows port.
9084         Reported by Martin Rudalics <rudalics@gmx.at>.
9085         * w32.c (init_environment): Replace comma with semicolon.
9086         * w32fns.c (syms_of_w32fns): Add missing parenthesis.
9088 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
9090         Improve GDB symbol export (Bug#12036).
9091         * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9092         arms of an 'if', not using conditional expressions; otherwise GDB
9093         complains about the types in the unevaluated arm when the argument
9094         is an integer literal.
9095         (xgetint): Simplify expression.
9096         * alloc.c (gdb_make_enums_visible): New constant.  This ports to
9097         GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
9098         Zaretskii in <http://bugs.gnu.org/12036#13>.
9099         * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
9100         needed now that we have gdb_make_enums_visible.
9101         (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9102         (enum enum_USE_LSB_TAG):
9103         New enum types, packaging up enums that need to be exported to GDB.
9105 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
9107         Utility function to make a list from specified amount of objects.
9108         * lisp.h (enum constype): New datatype.
9109         (listn): New prototype.
9110         * alloc.c (listn): New function.
9111         (Fmemory_use_count, syms_of_alloc): Use it.
9112         * buffer.c (syms_of_buffer): Likewise.
9113         * callint.c (syms_of_callint): Likewise.
9114         * charset.c (define_charset_internal): Likewise.
9115         * coding.c (syms_of_coding): Likewise.
9116         * keymap.c (syms_of_keymap): Likewise.
9117         * search.c (syms_of_search): Likewise.
9118         * syntax.c (syms_of_syntax): Likewise.
9119         * w32.c (init_environment): Likewise.
9120         * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9121         * xdisp.c (syms_of_xdisp): Likewise.
9122         * xfns.c (syms_of_xfns): Likewise.
9124 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
9126         Fast save_excursion_save and save_excursion_restore.
9127         * lisp.h (struct Lisp_Excursion): New data type.
9128         (PVEC_EXCURSION): New pseudovector type.
9129         (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9130         to deal with it.  Adjust comments.
9131         (init_marker, attach_marker): New prototype.
9132         (unchain_marker): Adjust prototype.
9133         * marker.c (attach_marker): Change to global.
9134         (init_marker): New function.
9135         * alloc.c (Fmake_marker, build_marker): Use it.
9136         (build_marker): More easserts.
9137         (mark_object): Handle struct Lisp_Excursion.
9138         * editfns.c (save_excursion_save, save_excursion_restore):
9139         Reimplement to use struct Lisp_Excursion.  Add comments.
9141 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
9143         Fix export of symbols to GDB (Bug#12036).
9144         * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9145         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9146         emacs.c, as this is a more-suitable home.  Had this been done earlier
9147         the fix for 12036 would have avoided some of the problems noted in
9148         <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9149         would have been more obvious.
9150         * emacs.c: Do not include <verify.h>; no longer needed.
9151         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
9152         (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9153         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9154         Remove; now done in lisp.h.
9155         * lisp.h (PUBLISH_TO_GDB): New macro.
9156         (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9157         (DATA_SEG_BITS): Use it.
9158         (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9159         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9160         * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9161         not be usable in #if.  This simplifies things.
9163 2012-07-26  Juanma Barranquero  <lekktu@gmail.com>
9165         * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9167 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
9169         Simplify export of symbols to GDB (Bug#12036).
9170         * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9171         $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9172         (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9173         Adjust to changes in lisp.h and emacs.c, by using
9174         CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9175         of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9176         INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9177         gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9178         instead of gdb_valbits.
9179         (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9180         PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9181         instead of gdb_array_mark_flag.
9182         (xboolvector): Get size from $->size, not $->header.size.
9183         Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9184         (xreload, hook-run, hookpost-run): Remove.
9185         * emacs.c: Include <verify.h>.
9186         (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9187         (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9188         Remove.
9189         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9190         (gdb_USE_LSB_TAG): New enum constants.
9191         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9192         Also define these as enum constants, so they're visible to GDB.
9193         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9194         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9195         as constants, so they're visible to GDB.
9196         * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9197         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9198         Now enum constants, not macros, so they're visible to GDB.
9199         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9200         more convenient now.  All uses changed.
9201         (VALMASK) [USE_LSB_TAG]: Also define in this case.
9202         * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9204 2012-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
9206         Explicitly free restriction data that are not needed anymore.
9207         * editfns.c (save_restriction_restore): Free restriction data.
9209 2012-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
9211         * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9212         add argument, tune behavior, and adjust all callers.
9214 2012-07-25  Paul Eggert  <eggert@cs.ucla.edu>
9216         Use typedef for EMACS_INT, EMACS_UINT.
9217         * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9218         than macros.  This simplifies debugging in the usual case, since
9219         it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9220         and it allows expressions involving EMACS_INT casts.
9221         * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9223 2012-07-25  Jan Djärv  <jan.h.d@swipnet.se>
9225         * nsterm.m (ns_read_socket): Return early if there is a modal
9226         window (Bug#12043).
9228 2012-07-25  Martin Rudalics  <rudalics@gmx.at>
9230         * frame.c (Fredirect_frame_focus): In doc-string don't mention
9231         that FOCUS-FRAME can be omitted.
9233 2012-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
9235         Adjust buffer text indirection counters at the end of Fkill_buffer.
9236         * buffer.c (Fkill_buffer): Adjust indirection counters when the
9237         buffer is definitely dead.  This should really fix an issue reported
9238         by Christoph Scholtes again.  (Bug#12007).
9239         (init_buffer_once): Initialize indirection counters of
9240         buffer_defaults and buffer_local_symbols (for sanity and safety).
9242 2012-07-24  Eli Zaretskii  <eliz@gnu.org>
9244         * xdisp.c (init_iterator): Don't compute dimensions of truncation
9245         and continuation glyphs on tooltip frames, leave them at zero.
9246         Avoids continued lines in tooltips.  (Bug#11832)
9248 2012-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
9250         Simplify copy_overlay.
9251         * buffer.c (copy_overlay): Simplify.  Use build_marker.
9252         * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9254 2012-07-23  Eli Zaretskii  <eliz@gnu.org>
9256         * print.c (print_object): Don't crash when a frame's name is nil
9257         or invalid.  (Bug#12025)
9259         * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9260         it signals an error when a tooltip frame is being created.
9262 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
9264         Cleanup miscellaneous objects allocation and initialization.
9265         * alloc.c (allocate_misc): Change to static.  Add argument to
9266         specify the subtype.  Adjust comment and users.
9267         (build_overlay): New function.
9268         * buffer.c (copy_overlays, Fmake_overlay): Use it.
9269         * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9270         (allocate_misc): Remove prototype.
9271         (build_overlay): Add prototype.
9273 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
9275         Swap buffer text indirection counters in Fbuffer_swap_text.
9276         * buffer.c (Fbuffer_swap_text): Swap indirections too.
9277         This avoids crash reported by Christoph Scholtes at
9278         http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9280 2012-07-22  Jan Djärv  <jan.h.d@swipnet.se>
9282         * nsmenu.m (Popdown_data): New struct.
9283         (pop_down_menu): p->pointer is Popdown_data.  Release the pool and
9284         free Popdown_data.
9285         (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9286         (initWithContentRect): Make imgView and contentView non-static
9287         and autorelease them.  Also autorelease img and matrix (Bug#12005).
9288         (dealloc): Remove (Bug#12005).
9290 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
9292         Adjust consing_since_gc when objects are explicitly freed.
9293         * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9294         (Fgarbage_collect): Use it.  Change minimum to 1/10 of default.
9295         (free_cons, free_misc): Subtract object size from consing_since_gc.
9297 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
9299         Simplify and cleanup markers positioning code.
9300         * marker.c (attach_marker): More useful eassert.
9301         (live_buffer, set_marker_internal): New function.
9302         (Fset_marker, set_marker_restricted): Use set_marker_internal.
9303         (set_marker_both, set_marker_restricted_both): Use live_buffer.
9305 2012-07-22  Paul Eggert  <eggert@cs.ucla.edu>
9307         * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9308         as it's limited by the amount of memory, not by INT_MAX.
9310 2012-07-21  Eli Zaretskii  <eliz@gnu.org>
9312         * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9313         in special-event-map.  See the discussion at
9314         http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9315         for the reasons.
9317         * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
9318         info.dwItemData.  Fixes crashes on 64-bit Windows.
9319         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
9321 2012-07-21  Jan Djärv  <jan.h.d@swipnet.se>
9323         * nsterm.m (accessibilityAttributeValue): New function.  (Bug#11134).
9324         (conversationIdentifier): Return value is NSInteger.
9325         * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
9327 2012-07-21  Chong Yidong  <cyd@gnu.org>
9329         * window.c (decode_any_window): Signal an error if the window is
9330         on a dead frame (Bug#11984).
9332 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
9334         Add indirection counting to speed up Fkill_buffer.
9335         * buffer.h (struct buffer): New member.
9336         * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9337         (Fmake_indirect_buffer): Set indirection counter to -1, increment
9338         base buffer indirection counter.
9339         (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9340         (Fkill_buffer): Adjust indirection counters as needed, don't walk
9341         through buffer list if indirection counter is 0.
9343 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
9345         Extend the value returned by Fgarbage_collect with heap statistics.
9346         * alloc.c (Qheap): New symbol.
9347         (syms_of_alloc): DEFSYM it.
9348         (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9349         (Fmemory_free): Remove.
9350         (syms_of_alloc): Don't defsubr it.
9351         * buffer.c (Fcompact_buffer): Remove.
9352         (syms_of_buffer): Don't defsubr it.
9354 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
9356         Make maybe_gc inline.
9357         Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9358         * lisp.h (consing_since_gc, gc_relative_threshold)
9359         (memory_full_cons_threshold): Revert declaration.
9360         (maybe_gc): Remove prototype, define as inline.
9361         * alloc.c: Remove old commented-out code.
9362         (consing_since_gc, gc_relative_threshold)
9363         (memory_full_cons_threshold): Revert to global.
9364         (maybe_gc): Remove.
9366 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
9368         Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9369         * lisp.h (build_unibyte_string): New function.
9370         * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9371         * sysdep.c, w32fns.c, xfns.c: Use it.
9372         * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9373         of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9374         Adjust users accordingly.
9375         * font.h (font_open_by_name): Adjust prototype.
9377 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
9379         Cleanup calls to Fgarbage_collect.
9380         * lisp.h (maybe_gc): New prototype.
9381         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9382         Remove declarations.
9383         * alloc.c (maybe_gc): New function.
9384         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9385         Make them static.
9386         * bytecode.c (MAYBE_GC): Use maybe_gc.
9387         * eval.c (eval_sub, Ffuncall): Likewise.
9388         * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
9389         to avoid dependency from auto-save feature.
9391 2012-07-19  Paul Eggert  <eggert@cs.ucla.edu>
9393         * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9394         (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9395         'for_each_per_buffer_object_at'.
9396         All uses changed.  It's better to use upper-case for macros that
9397         cannot be implemented as functions, to give the reader a clue
9398         that they're special.
9400 2012-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
9402         * alloc.c (Fgarbage_collect): Tweak docstring.
9404 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
9406         Tweak the value returned from Fgarbage_collect again.
9407         * alloc.c (Fgarbage_collect): New return value, as confirmed in
9408         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9409         Adjust documentation.
9410         (total_vector_bytes): Rename to total_vector_slots, adjust
9411         accounting.
9412         (total_free_vector_bytes): Rename to total_free_vector_slots,
9413         adjust accounting.
9414         (Qstring_bytes, Qvector_slots): New symbols.
9415         (syms_of_alloc): DEFSYM them.
9417 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
9419         Buffer compaction primitive which may be used from Lisp.
9420         * buffer.c (compact_buffer, Fcompact_buffer): New function.
9421         (syms_of_buffer): Register Fcompact_buffer.
9422         * alloc.c (Fgarbage_collect): Use compact_buffer.
9423         * buffer.h (compact_buffer): New prototype.
9424         (struct buffer_text): New member.
9426 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
9428         New macro to iterate over all buffers, miscellaneous cleanups.
9429         * lisp.h (all_buffers): Remove declaration.
9430         * buffer.h (all_buffers): Add declaration, with comment.
9431         (for_each_buffer): New macro.
9432         * alloc.c (Fgarbage_collect, mark_object): Use it.
9433         * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9434         (init_buffer): Likewise.
9435         * data.c (Fset_default): Likewise.
9436         * coding.c (code_conversion_restore): Remove redundant check
9437         for dead buffer.
9438         * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
9440 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
9442         Fix bug that created negative-length intervals.
9443         * intervals.c (merge_interval_right, merge_interval_left):
9444         Do not zero out this interval if it is absorbed by its children,
9445         as this interval's total length doesn't change in that case.  See
9446         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9448 2012-07-18  Paul Eggert  <eggert@cs.ucla.edu>
9450         * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9451         when invoking (make-bool-vector N t) and N is a positive
9452         multiple of 8 -- the last 8 bits were mistakenly cleared.
9454         Remove some struct layout assumptions in bool vectors.
9455         * alloc.c (bool_header_size): New constant.
9456         (header_size, word_size): Move earlier, as they're now used earlier.
9457         Use 'word_size' in a few more places, where it's appropriate.
9458         (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9459         padding before the data member of a bool vector.
9460         (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9461         than doing the check by hand with an abort ().
9463 2012-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
9465         * eval.c (Fdefvar): Don't check constants since we only set the var if
9466         it's not yet defined anyway (bug#11904).
9468         * lisp.h (last_undo_boundary): Declare new var.
9469         * keyboard.c (command_loop_1): Set it.
9470         * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9471         were auto-added by the command loop (bug#11774).
9473 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
9475         * w32font.c (Qsymbol): Remove local definition.
9476         (syms_of_w32font): Don't DEFSYM it.
9478 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
9480         Fix sweep_vectors to handle large bool vectors correctly.
9481         * alloc.c (sweep_vectors): Account total_vector_bytes for
9482         bool vectors larger than VBLOCK_BYTES_MAX.
9484 2012-07-18  Chong Yidong  <cyd@gnu.org>
9486         * frame.c (x_set_frame_parameters): Revert bogus change introduced
9487         in 2012-05-25 commit by Paul Eggert (Bug#11738).
9489 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
9491         Return more descriptive data from Fgarbage_collect.
9492         Suggested by Stefan Monnier in
9493         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9494         * alloc.c (bounded_number): New function.
9495         (total_buffers, total_vectors): New variable.
9496         (total_string_size): Rename to total_string_bytes, adjust users.
9497         (total_vector_size): Rename to total_vector_bytes, adjust users.
9498         (sweep_vectors): Account total_vectors and total_vector_bytes.
9499         (Fgarbage_collect): New return value.  Adjust documentation.
9500         (gc_sweep): Account total_buffers.
9501         (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9502         (VECTOR_SIZE): Remove.
9503         * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9504         (Qinterval, Qmisc): New symbols.
9505         (syms_of_data): Initialize them.
9506         * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9507         (Qcons, Qbuffer): New declarations.
9509 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
9511         * alloc.c (Fmemory_free): Account for memory-free's own storage.
9512         Round up, not down.  Improve doc.
9514 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
9516         Restore old code in allocate_string_data to avoid Faset breakage.
9517         Reported by Julien Danjou <julien@danjou.info> in
9518         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9519         * alloc.c (allocate_string_data): Restore old code with minor
9520         adjustments, fix comment to explain this subtle issue.
9522 2012-07-17  Eli Zaretskii  <eliz@gnu.org>
9524         Remove FILE_SYSTEM_CASE.
9525         * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9527         * fileio.c (FILE_SYSTEM_CASE): Don't define.
9528         (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9529         Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9530         call-process-region passes it through expand-file-name.
9532         * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9534 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
9536         Fix crash when creating indirect buffer (Bug#11917)
9537         * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9538         Don't handle unbound variables specially if non-zero.
9539         (Fbuffer_local_variables): Pass zero.
9540         (clone_per_buffer_values): Pass non-zero.
9542 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
9544         * gnutls.c (emacs_gnutls_handshake): Revert last change.  Add QUIT
9545         to make the loop interruptible.
9547 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
9549         * gnutls.c (emacs_gnutls_handshake): Only retry if
9550         GNUTLS_E_INTERRUPTED.
9552 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
9554         Cleanup and convert miscellaneous checks to eassert.
9555         * alloc.c (mark_interval): Fix comment, partially rephrase
9556         old comment from intervals.h (see below).
9557         * intervals.c (find_interval, adjust_intervals_for_insertion)
9558         (delete_interval, adjust_intervals_for_deletion)
9559         (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9560         Convert to eassert.
9561         (adjust_intervals_for_insertion, make_new_interval):
9562         Remove obsolete and unused code.
9563         * intervals.h (struct interval): Remove obsolete comment.
9564         * textprotp.c (erase_properties): Remove unused code.
9565         (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9566         (Fremove_list_of_text_properties): Convert to eassert.
9568 2012-07-17  Chong Yidong  <cyd@gnu.org>
9570         * editfns.c (Finsert_char): Doc fix.
9572 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
9574         Fix previous change to make Fmemory_free always accurate.
9575         * alloc.c (make_interval): Update total_free_intervals.
9576         (make_float): Likewise for total_free_floats.
9577         (free_cons, Fcons): Likewise for total_free_conses.
9578         (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9579         Likewise for total_free_vector_bytes.
9580         (Fmake_symbol): Likewise for total_free_symbols.
9581         (bytes_free): Remove.
9583 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
9585         Simple free memory accounting feature.
9586         * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9587         (sweep_vectors): Accumulate size of free vectors.
9588         (Fgarbage_collect): Setup bytes_free.
9589         (Fmemory_free): New function.
9590         (syms_of_alloc): Register it.
9592 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
9594         Cleanup overlays checking.
9595         * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9596         * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9597         eassert and OVERLAYP.
9598         (sort_overlays): Change to use OVERLAYP.
9600 2012-07-16  René Kyllingstad  <Rene@Kyllingstad.com>  (tiny change)
9602         * editfns.c (Finsert_char): Make it interactive, and make the
9603         second arg optional.  Copy interactive spec and docstring from
9604         ucs-insert.
9606 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
9608         * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9609         Unlike the other wrapped functions, fabs has an unspecified
9610         effect on errno.
9612 2012-07-16  Jan Djärv  <jan.h.d@swipnet.se>
9614         * nsterm.m (keyDown): Interpret flags without left/right bits
9615         as the left key (Bug#11670).
9617 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
9619         Remove empty and useless init functions.
9620         * lisp.h (init_character_once, init_fns, init_image)
9621         (init_filelock, init_sound): Remove prototype.
9622         * character.c (init_character_once): Remove.
9623         * filelock.c (init_filelock): Likewise.
9624         * fns.c (init_fns): Likewise.
9625         * image.c (init_image): Likewise.
9626         * sound.c (init_sound): Likewise.
9627         * emacs.c (main): Adjust accordingly.
9629 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
9631         * gtkutil.h: Tiny cleanups.
9632         (use_old_gtk_file_dialog): Remove useless declaration.
9633         (xg_uses_old_file_dialog): Add suggested const attribute.
9635 2012-07-15  Eli Zaretskii  <eliz@gnu.org>
9637         * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9638         (bidi_paragraph_init): Use it to limit search forward for a strong
9639         directional character in abnormally large paragraphs full of
9640         neutral or weak characters.  (Bug#11943)
9642 2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
9644         * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9645         the toolbar (Bug#9451).
9646         (xg_make_tool_item): Give the widget event box a transparent
9647         background.
9649 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
9651         Cleanup basic allocation variables and functions.
9652         * alloc.c (ignore_warnings, init_intervals, init_float)
9653         (init_cons, init_symbol, init_marker): Remove.
9654         (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9655         (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9656         (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9657         (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9658         (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9659         (staticidx, init_alloc_once, init_strings, free_ablock):
9660         Remove redundant initialization.
9661         * fns.c (init_weak_hash_tables): Remove.
9662         * lisp.h (init_weak_hash_tables): Remove prototype.
9664 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
9666         Use zero_vector where appropriate.
9667         * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
9668         accordingly.
9669         * lisp.h (zero_vector): New declaration.
9670         * font.c (null_vector): Remove.
9671         (syms_of_font): Remove initialization and staticpro.
9672         (font_list_entities, font_find_for_lface): Change to use zero_vector.
9673         * keymap.c (Faccessible_keymaps): Likewise.
9675 2012-07-15  Leo Liu  <sdl.web@gmail.com>
9677         * fringe.c: Fix typo in comments.
9679 2012-07-14  Leo Liu  <sdl.web@gmail.com>
9681         * fringe.c: Add a new bitmap exclamation-mark.
9683 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
9685         * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9687         * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9688         (HAVE_MENUS): Don't define, defined by editing config.in with
9689         msdos/sed2v2.inp.
9690         (GMALLOC_INHIBIT_VALLOC): Don't define.
9691         (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9693 2012-07-14  Juanma Barranquero  <lekktu@gmail.com>
9695         * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9697 2012-07-14  Glenn Morris  <rgm@gnu.org>
9699         * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9700         * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9701         Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9703 2012-07-13  Glenn Morris  <rgm@gnu.org>
9705         * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9707         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9708         * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9710 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
9712         * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9713         (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9714         (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9715         (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9716         where appropriate.
9717         (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9718         as boolean expression.
9719         (x_set_window_size): Remove unused variable toolbar.
9720         (ns_get_color_default, ns_mod_to_lisp): Remove.
9721         (ns_mouse_position): Remove unused variables xchar and ychar.
9722         (ns_compute_glyph_string_overhangs): Remove unused variable face.
9723         (ns_set_vertical_scroll_bar): Remove unused variable count.
9724         (ns_delete_terminal): Remove unused variable i.
9725         (ns_term_init): Remove unused variables r, g and b.
9726         (mouseDown): Remove unused variable window.
9727         (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9728         (initFrameFromEmacs): Remove unused variable vbextra.
9729         (mouseEntered): Remove unused variables p and dpyinfo.
9730         (mouseExited): Remove unused variables p and r.
9731         (ns_define_frame_cursor, ns_clear_frame_area)
9732         (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9733         (menuDown): Assign [sender tag] to variable and cast the variable.
9735         * nsterm.h (menuDown): Add id as type to argument sender.
9736         (ns_display_info_for_name): Add Lisp_Object argument.
9737         (ns_term_init): Add Lisp_Object argument.
9738         (ns_map_event_to_object): Add void argument.
9739         (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9740         prototype with arguments and only declare if __OBJC__.
9741         (nxatoms_of_nsselect): Add void argument.
9742         (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9743         (ns_alloc_autorelease_pool): Add void argument.
9744         (ns_release_autorelease_pool): Add void* argument.
9745         (ns_get_defaults_value): Add const char* argument.
9747         * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9748         (initFromContents): Use SSDATA where appropriate.
9749         (ns_update_menubar): Add braces to ambigous if-else.
9750         (initWithTitle): Put () around assignment in if statement.
9751         (ns_menu_show): Remove unused variables window and keymap.
9752         (update_frame_tool_bar): Remove unused variable selected_p.
9753         (initWithContentRect): Remove unused variable this_cmd_name.
9755         * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9756         appropriate.
9757         (setXBMColor): Remove unused variable len.
9758         (setPixmapData): Put () around assignment in loop statement.
9760         * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9761         (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9762         where appropriate.
9763         (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9764         around assignment in loop statement.
9765         (nsfont_open): Remove unused variable i.
9766         (nsfont_open): Remove unused variable len.
9767         (nsfont_draw): Remove unused variable cs.
9769         * nsfns.m (x_set_icon_name, ns_set_name_internal)
9770         (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9771         (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9772         (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9773         (Fns_font_name, Fns_perform_service)
9774         (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9775         (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9776         (ns_set_name): Remove unused variable view.
9777         (x_set_menu_bar_lines): Remove unused variable olines.
9778         (x_set_tool_bar_lines): Remove unused variable root_window.
9779         (Fns_list_colors): Put () around assignment in while statement.
9780         (Fns_perform_service): Remove unused variable len.
9781         (Fns_display_usable_bounds): Remove unused variable top.
9782         (syms_of_nsfns): Remove unused variable i.
9784         * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9785         memcpy (Bug#11907).
9787 2012-07-13  Kalle Kankare  <kalle.kankare@iki.fi>  (tiny change)
9789         * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9790         and free it with DestroyExceptionInfo (Bug#11558).
9792 2012-07-13  Juanma Barranquero  <lekktu@gmail.com>
9794         * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9795         (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9796         Set here, not in nt/config.nt.
9798 2012-07-13  Eli Zaretskii  <eliz@gnu.org>
9800         * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9801         cursor overflow into the last glyph on display line when the right
9802         fringe is off.  (Bug#11832)
9804 2012-07-13  Paul Eggert  <eggert@cs.ucla.edu>
9806         * xdisp.c (produce_special_glyphs): Now static.
9807         * dispextern.h (produce_special_glyphs): Remove decl.
9809 2012-07-13  Glenn Morris  <rgm@gnu.org>
9811         * s/bsd-common.h, s/cygwin.h: Remove empty files.
9812         * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9814         * s/usg5-4-common.h (USG, USG5):
9815         * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9816         * s/sol2-6.h (SOLARIS2):
9817         * s/irix6-5.h (IRIX6_5):
9818         * s/hpux10-20.h (USG, USG5, HPUX):
9819         * s/gnu-linux.h (USG, GNU_LINUX):
9820         * s/freebsd.h (BSD_SYSTEM):
9821         * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9822         * s/cygwin.h (CYGWIN):
9823         * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9824         * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9826 2012-07-13  BT Templeton  <bpt@hcoop.net>  (tiny change)
9828         * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
9830 2012-07-13  Glenn Morris  <rgm@gnu.org>
9832         * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9834         * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9836         * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9837         * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9839 2012-07-12  Glenn Morris  <rgm@gnu.org>
9841         * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
9843         * process.c (init_process_emacs): Rename from init_process.
9844         The old name is also the name of a Mach system call.
9845         * lisp.h, emacs.c: Update for this name change.
9846         * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9847         longer needed.
9849 2012-07-12  Eli Zaretskii  <eliz@gnu.org>
9851         * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9852         memmove call that removes glyphs covered by the left truncation
9853         glyph.  Improve commentary.
9854         (display_line): Fix display of continuation glyphs on GUI frames
9855         when the right fringe is turned off and variable-size fonts are
9856         used in the window.  Move the code that appends a stretch glyph to
9857         produce_special_glyphs, so that it could be used for truncation
9858         and continuation glyphs alike.
9859         (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9860         glyph of a suitably computed width, to align the special glyphs at
9861         the window margin.  Code moved from display_line.  (Bug#11832)
9863 2012-07-12  Glenn Morris  <rgm@gnu.org>
9865         * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9867         * s/gnu-linux.h, s/hpux10-20.h:
9868         Do not unconditionally define HAVE_XRMSETDATABASE.
9870         * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9872 2012-07-12  Paul Eggert  <eggert@cs.ucla.edu>
9874         Fix typos that broke OS X build.
9875         Reported by Randal L. Schwartz in
9876         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9877         * nsterm.m (ns_timeout): Add missing local decl.
9878         (ns_get_color): snprintf -> sprintf, to fix typo.
9880 2012-07-12  Glenn Morris  <rgm@gnu.org>
9882         * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9883         * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9884         * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9885         Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9887         * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9888         Move PTY_OPEN to configure.
9890         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9891         * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9892         * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9894 2012-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
9896         Use empty_unibyte_string where applicable.
9897         * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9898         * lread.c (read1): Likewise.
9899         * xsettings.c (syms_of_xsettings): Likewise.
9901 2012-07-12  Glenn Morris  <rgm@gnu.org>
9903         * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9904         * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
9905         * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9906         * s/hpux10-20.h (RUN_TIME_REMAP):
9907         * s/bsd-common.h (TABDLY): Move to configure.
9909         * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9911         * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9913         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9914         (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
9916         * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
9918         * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9919         * s/template.h: Move NARROWPROTO to configure.
9921 2012-07-11  Glenn Morris  <rgm@gnu.org>
9923         * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9924         unused since 2011-01-17 change to systty.h.
9926         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9927         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9928         Move HAVE_PTYS and HAVE_SOCKETS to configure.
9930 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
9932         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
9934 2012-07-11  Glenn Morris  <rgm@gnu.org>
9936         * s/darwin.h, s/gnu-linux.h, s/template.h:
9937         Move INTERRUPT_INPUT to configure.
9939 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
9941         Minor adjustments to interning code.
9942         * lisp.h (intern, intern_c_string): Redefine as static inline
9943         wrappers for intern_1 and intern_c_string_1, respectively.
9944         (intern_1, intern_c_string_1): Rename prototypes.
9945         * lread.c (intern_1, intern_c_string_1, oblookup):
9946         Simplify Vobarray checking.
9947         * font.c (font_intern_prop): Likewise.  Adjust comment.
9948         * w32font.c (intern_font_name): Likewise.
9950 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
9952         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9954         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9955         of Fcar/Fcdr if possible.
9956         * font.c (check_otf_features): Likewise.
9957         * fontset.c (Fnew_fontset): Likewise.
9958         * gnutls.c (Fgnutls_boot): Likewise.
9959         * minibuf.c (read_minibuf): Likewise.
9960         * msdos.c (IT_set_frame_parameters): Likewise.
9961         * xmenu.c (Fx_popup_dialog): Likewise.
9962         * w32menu.c (Fx_popup_dialog): Likewise.
9964 2012-07-11  Glenn Morris  <rgm@gnu.org>
9966         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9967         since nothing has defined it on these platforms.
9969         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9970         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9972         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9973         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9974         Move CLASH_DETECTION to configure.
9976         * s/gnu.h: Remove file, which is now empty.
9978         * s/gnu.h, s/gnu-linux.h:
9979         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9981 2012-07-11  John Wiegley  <johnw@newartisans.com>
9983         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9984         function attribute, so we only use it if it exists in the
9985         compiler.
9987 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
9989         Avoid call to strlen in fast_c_string_match_ignore_case.
9990         * search.c (fast_c_string_match_ignore_case): Change to use
9991         length argument.  Adjust users accordingly.
9992         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9994 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
9996         Assume mkdir, rmdir.
9997         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9998         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10000         Assume rename.
10001         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10003         Assume perror.
10004         * s/hpux10-20.h (HAVE_PERROR): Remove.
10005         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10006         Remove dummy definition, as this problem was obsolete long ago.
10008         Assume strerror.
10009         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10011 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
10013         Avoid calls to strlen in font processing functions.
10014         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
10015         (font_open_by_name): Change to use length argument.
10016         Adjust users accordingly.
10017         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10018         Adjust prototypes.
10019         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10020         Change to return ptrdiff_t.
10021         (xfont_list_pattern, xfont_match): Use length returned by
10022         xfont_decode_coding_xlfd.
10023         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10025 2012-07-11  Glenn Morris  <rgm@gnu.org>
10027         * s/darwin.h, s/freebsd.h, s/netbsd.h:
10028         Move DONT_REOPEN_PTY to configure.
10030         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10031         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10033 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
10035         Remove "#define unix" that is no longer needed (Bug#11905).
10036         * s/aix4-2.h (unix): Remove; no longer needed.
10038         EMACS_TIME simplification (Bug#11875).
10039         This replaces macros (which typically do not work in GDB)
10040         with functions, typedefs and enums, making the code easier to debug.
10041         The functional style also makes code easier to read and maintain.
10042         * systime.h: Include <sys/time.h> on all hosts, not just if
10043         WINDOWSNT, since 'struct timeval' is needed in general.
10044         (EMACS_TIME): Now a typedef, not a macro.
10045         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10046         not macros.
10047         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10048         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10049         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10050         (EMACS_TIME_LE): Now functions, not macros.
10051         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10052         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10053         which are not functions.  All uses rewritten to use:
10054         (make_emacs_time): New function.
10055         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10056         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10057         not functions.  All uses rewritten to use the following, respectively:
10058         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10059         (add_emacs_time, sub_emacs_time): New functions.
10060         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
10061         * fileio.c (Fcopy_file):
10062         * xterm.c (XTflash): Get the current time closer to when it's used.
10063         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10065         * bytecode.c (targets): Suppress -Woverride-init warnings.
10067         Simplify by avoiding confusing use of strncpy etc.
10068         * doc.c (Fsnarf_documentation):
10069         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10070         * frame.c (Fmake_terminal_frame):
10071         * gtkutil.c (get_utf8_string):
10072         * lread.c (openp):
10073         * nsmenu.m (ns_update_menubar):
10074         * regex.c (regerror):
10075         Prefer memcpy to strncpy and strncat when either will do.
10076         * fileio.c (Fsubstitute_in_file_name):
10077         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10078         (menu_separator_name_p):
10079         * nsmenu.m (ns_update_menubar):
10080         Prefer memcmp to strncmp when either will do.
10081         * nsterm.m: Include <ftoastr.h>.
10082         (ns_get_color):
10083         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10084         Prefer snprintf to strncpy.
10085         * nsterm.m (ns_term_init):
10086         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10087         * nsterm.m (ns_term_init):
10088         Avoid the need for strncpy, by using build_string or
10089         make_unibyte_string directly.  Use dtoastr, not snprintf.
10090         * process.c (Fmake_network_process): Diagnose service names that
10091         are too long, rather than silently truncating them or creating
10092         non-null-terminated names.
10093         (Fnetwork_interface_info): Likewise, for interface names.
10094         * sysdep.c (system_process_attributes) [GNU_LINUX]:
10095         Prefer sprintf to strncat.
10096         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10097         Prefer vsnprintf to vsprintf + strncpy.
10099 2012-07-10  Glenn Morris  <rgm@gnu.org>
10101         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10102         Clarify fallback case.
10104 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
10106         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10107         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10108         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
10109         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
10110         where argument type is known to be a Lisp_Cons.
10112 2012-07-10  Tom Tromey  <tromey@redhat.com>
10114         * bytecode.c (BYTE_CODE_THREADED): New macro.
10115         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
10116         (enum byte_code_op): New type.
10117         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10118         (exec_byte_code): Use them.  Use token threading when applicable.
10120 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
10122         Optimize pure C strings initialization.
10123         * lisp.h (make_pure_string): Fix prototype.
10124         (build_pure_c_string): New function, defined as static inline.  This
10125         provides a better opportunity to optimize away calls to strlen when
10126         the function is called with compile-time constant argument.
10127         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
10128         argument, adjust users accordingly.  Use build_pure_c_string where
10129         appropriate.
10130         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10131         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10132         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10134 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
10136         Avoid calls to strlen in miscellaneous functions.
10137         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10138         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
10139         * lread.c (openp): Likewise.
10141 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
10143         Avoid calls to strlen in path processing functions.
10144         * fileio.c (file_name_as_directory): Add comment.  Change to add
10145         srclen argument and return the length of result.  Adjust users
10146         accordingly.
10147         (directory_file_name): Fix comment.  Change to add srclen argument,
10148         swap 1st and 2nd arguments to obey the common convention.
10149         Adjust users accordingly.
10150         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10152 2012-07-10  Glenn Morris  <rgm@gnu.org>
10154         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10155         Move PENDING_OUTPUT_COUNT definition to configure.
10157         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10158         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10159         * s/gnu.h (DATA_START): Move definitions to configure.
10161         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10162         We include usg5-4-common.h, which defines them both.
10164         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10165         O_RDONLY already includes it).
10167         Stop ns builds setting the EMACSLOADPATH environment variable.
10168         * nsterm.m (ns_load_path): Rename from ns_init_paths.
10169         Now it does not set EMACSLOADPATH, just returns the load-path string.
10170         * nsterm.h: Update accordingly.
10171         * lread.c [HAVE_NS]: Include nsterm.h.
10172         (init_lread) [HAVE_NS]: Use ns_load_path.
10173         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10175 2012-07-09  Glenn Morris  <rgm@gnu.org>
10177         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10178         since the included bsd-common.h does so.
10180         Stop ns builds setting the EMACSPATH environment variable.
10181         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10182         (ns_init_paths): Do not set EMACSPATH.
10183         * nsterm.h (ns_exec_path): Add it.
10184         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10185         Use ns_exec_path.
10187         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10189 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
10191         * process.c (wait_reading_process_output): 'waitchannels' was unset
10192         when read_kbd || !NILP (wait_for_cell); fix this.
10194         Add GCC-style 'const' attribute to functions that can use it.
10195         * character.h (char_resolve_modifier_mask):
10196         * keyboard.h (make_ctrl_char):
10197         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10198         (init_character_once, next_almost_prime, init_fns, init_image)
10199         (flush_pending_output, init_sound):
10200         * mem-limits.h (start_of_data):
10201         * menu.h (finish_menu_items):
10202         Add ATTRIBUTE_CONST.
10203         * emacs.c (DEFINE_DUMMY_FUNCTION):
10204         Declare the dummy function with ATTRIBUTE_CONST.
10205         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10206         Add decls with ATTRIBUTE_CONST.
10208         Minor improvements to make_formatted_string.
10209         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10210         where int is good enough, as vsprintf returns an int.
10211         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10213 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
10215         Use make_formatted_string to avoid double length calculation.
10216         * lisp.h (make_formatted_string): New prototype.
10217         * alloc.c (make_formatted_string): New function.
10218         * buffer.c (Fgenerate_new_buffer_name): Use it.
10219         * dbusbind.c (syms_of_dbusbind): Likewise.
10220         * editfns.c (Fcurrent_time_zone): Likewise.
10221         * filelock.c (get_boot_time): Likewise.
10222         * frame.c (make_terminal_frame, set_term_frame_name)
10223         (x_report_frame_params): Likewise.
10224         * image.c (gs_load): Likewise.
10225         * minibuf.c (get_minibuffer): Likewise.
10226         * msdos.c (dos_set_window_size): Likewise.
10227         * process.c (make_process): Likewise.
10228         * xdisp.c (ensure_echo_area_buffers): Likewise.
10229         * xsettings.c (apply_xft_settings): Likewise.
10231 2012-07-09  Glenn Morris  <rgm@gnu.org>
10233         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10234         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10235         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10236         * nsterm.h (ns_etc_directory): Add it.
10237         * callproc.c [HAVE_NS]: Include nsterm.h.
10238         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10240 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
10242         Move marker debugging code under MARKER_DEBUG.
10243         * marker.c (MARKER_DEBUG): Move marker debugging code under
10244         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10245         for bootstrap with --enable-checking (~3x slowdown reported
10246         by Juanma Barranquero <lekktu@gmail.com>).
10247         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10249 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
10251         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10252         See <http://bugs.gnu.org/11825#29>.
10254 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
10256         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10257         has no font, use the frame's font.  (Bug#11813)
10258         (display_line): Add commentary about displaying truncation glyphs
10259         on GUI frames.
10260         (produce_special_glyphs): Move here from term.c.
10262         * term.c (produce_special_glyphs): Move to xdisp.c.
10264         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10265         section.
10267 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
10269         * xdisp.c (display_line): Avoid warning about implicit declaration
10270         of FRAME_FONT.
10272         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10274         * lisp.h: Remove empty conditional.
10276 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
10278         * lread.c (load_path_check): Now static.
10280         Fix some minor --with-ns problems found by static checking.
10281         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10282         (x_set_font) [!HAVE_X_WINDOWS]:
10283         * image.c (xpm_load_image) [HAVE_NS]:
10284         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10285         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10286         Remove unused local.
10287         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10288         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10289         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10290         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10291         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10292         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10293         Fix pointer signedness problem.
10294         * xfaces.c (FRAME_X_FONT_TABLE):
10295         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10297 2012-07-07  Glenn Morris  <rgm@gnu.org>
10299         * lread.c (load_path_check): New function, split from init_lread.
10300         (init_lread): Reorganize.  Motivation:
10301         If EMACSLOADPATH is set, check/warn about that rather than the
10302         defaults, which we are not going to use.  Hence we can remove
10303         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10304         Don't warn if site-lisp directories are missing.
10305         If not installed, start from a blank load-path, since
10306         PATH_LOADSEARCH refers to the eventual installation directories.
10308 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
10310         Support truncation and continuation glyphs on GUI frames, when
10311         fringes are disabled.  (Bug#11832)
10312         * xdisp.c (init_iterator): Get dimensions of truncation and
10313         continuation glyphs even if on GUI frames.
10314         Adjust it->last_visible_x on GUI frames when the left or right fringes,
10315         or both, are absent.
10316         (start_display, move_it_in_display_line_to): Handle the case of a
10317         GUI frame without a fringe to display continuation or truncation
10318         glyphs.
10319         (insert_left_trunc_glyphs): Support GUI frames: make sure
10320         truncation glyphs overwrite enough glyphs from the current line to
10321         have sufficient space in pixels.
10322         (display_line): Support truncation and continuation glyphs on GUI
10323         frames.  If some spare pixels are left on the line after inserting
10324         the truncation glyphs, fill that space with a stretch glyph of a
10325         suitably computed width.
10327         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10328         produce_glyphs, to support GUI sessions.
10330 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
10332         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10334         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10336         Do not require float-time's arg to fit in time_t (Bug#11825).
10337         This works better on hosts where time_t is unsigned, and where
10338         float-time is applied to the (negative) difference between two times.
10339         * editfns.c (decode_time_components): Last arg is now double *,
10340         not int *, and means to store all the result as a double, without
10341         worrying about whether the seconds part fits in time_t.
10342         All callers changed.
10343         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10344         All callers changed.
10345         (Ffloat_time): Do not fail merely because the specified time falls
10346         outside of time_t range.
10348 2012-07-07  Glenn Morris  <rgm@gnu.org>
10350         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10351         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10352         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10354 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
10356         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10357         Update dependencies.
10359         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10361 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
10363         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10364         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10365         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10366         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10367         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10368         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10370         * xfont.c (compare_font_names): Redo to omit the need for casts.
10372 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
10374         * xfns.c (Fx_change_window_property): Doc fix.
10375         * w32fns.c (Fx_change_window_property): Doc fix.
10377         * w32fns.c (Fx_window_property): Accept the same arguments as the
10378         X Windows version.  Doc fix.
10379         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
10381 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
10382             Eli Zaretskii  <eliz@gnu.org>
10384         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10385         Windows-specific code from nt/config.nt moved here.
10386         Obsolete settings removed.
10388 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
10390         * process.c: Avoid unnecessary calls to gettime.
10391         (wait_reading_process_output): Don't get the time of day
10392         when gobbling data immediately and not waiting, as there's no need
10393         for it in that case.  This removes a FIXME.
10395 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
10397         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10398         is defined (Bug#11768).
10400 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10402         Fix marker debugging code.
10403         * marker.c (byte_char_debug_check): Do not perform the check
10404         if buffer is not multibyte.
10405         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10406         Call byte_char_debug_check with correct arguments.
10408 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10410         Compile marker debugging code only if ENABLE_CHECKING is defined.
10411         * marker.c (byte_char_debug_check, count_markers):
10412         Use only if ENABLE_CHECKING is defined.
10413         (byte_debug_flag): Remove.
10414         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10415         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10417 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10419         Avoid code repetition in marker-related functions.
10420         * marker.c (attach_marker): New function.
10421         (Fset_marker, set_marker_restricted, set_marker_both)
10422         (set_marker_restricted_both): Use it.
10423         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10424         Consistently rename charno to charpos.
10425         (marker_position): Add eassert.
10426         (marker_byte_position): Convert to eassert.
10428 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10430         Simplify list operations in unchain_overlay and unchain_marker.
10431         * buffer.c (unchain_overlay): Simplify.  Add comment.
10432         * marker.c (unchain_marker): Simplify.  Fix comments.
10434 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10436         Introduce fast path for the widely used marker operation.
10437         * alloc.c (build_marker): New function.
10438         * lisp.h (build_marker): New prototype.
10439         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10440         * composite.c (autocmp_chars): Likewise.
10441         * editfns.c (buildmark): Remove.
10442         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10443         (save_restriction_save): Use build_marker.
10444         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10445         * window.c (save_window_save): Likewise.
10447 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10449         Do not use Fdelete_overlay in delete_all_overlays
10450         to avoid redundant calls to unchain_overlay.
10451         * buffer.c (drop_overlay): New function.
10452         (delete_all_overlays, Fdelete_overlay): Use it.
10453         * minibuf.c (get_minibuffer): Fix comment.
10455 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
10457         Port to OpenBSD 5.1 amd64.
10458         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10459         This is needed for OpenBSD, and should be harmless on all BSD systems.
10460         Also, include <sys/sysctl.h>, as it should be available on all
10461         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10462         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10463         use p_pid member, not kp_proc.pid.
10465 2012-07-06  Glenn Morris  <rgm@gnu.org>
10467         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10469 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
10471         More xmalloc and related cleanup.
10472         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10473         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10474         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10475         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10476         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10477         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10478         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10479         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10480         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10481         * xterm.c:
10482         Omit needless casts involving void * pointers and allocation.
10483         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10484         as the former is more robust if P's type is changed.
10485         Prefer xzalloc to xmalloc + memset 0.
10486         Simplify malloc-or-realloc to realloc.
10487         Don't worry about xmalloc returning a null pointer.
10488         Prefer xstrdup to xmalloc + strcpy.
10489         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10490         growing it.
10491         * keyboard.c (apply_modifiers_uncached): Prefer local array to
10492         alloca of a constant.
10494 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
10496         * xdisp.c (display_line): Fix horizontal pixel coordinates when
10497         hscroll is larger than the line width.  Fixes long and futile
10498         looping inside extend_face_to_end_of_line (on a TTY) producing
10499         glyphs that are not needed and thrown away.
10501 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
10503         * marker.c (set_marker_restricted_both): Simplify by using
10504         clip_to_bounds.
10506 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
10508         * editfns.c (region_limit): Simplify by using clip_to_bounds.
10510 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
10512         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10513         not defined (Bug#11768).
10514         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10515         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10516         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10517         followed by gtk_box_set_homogeneous (Bug#11768).
10518         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
10519         (update_theme_scrollbar_width, xg_create_scroll_bar):
10520         Use gtk_scrollbar_new (Bug#11768).
10521         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10522         (is_box_type): New function (Bug#11768).
10523         (xg_tool_item_stale_p): Call is_box_type.
10524         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
10525         with default display (Bug#11768).
10527 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
10529         * xdisp.c (window_hscroll_limited): New function.
10530         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10531         coordinates when window's hscroll is set to insanely large
10532         values.  (Bug#11857)
10534 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
10536         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10537         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10539 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
10541         Cleanup xmalloc.
10542         * lisp.h (xzalloc): New prototype.  Omit needless casts.
10543         * alloc.c (xzalloc): New function.  Omit needless casts.
10544         * charset.c: Omit needless casts.  Convert all calls to
10545         xmalloc with following memset to xzalloc.
10546         * dispnew.c: Likewise.
10547         * fringe.c: Likewise.
10548         * image.c: Likewise.
10549         * sound.c: Likewise.
10550         * term.c: Likewise.
10551         * w32fns.c: Likewise.
10552         * w32font.c: Likewise.
10553         * w32term.c: Likewise.
10554         * xfaces.c: Likewise.
10555         * xfns.c: Likewise.
10556         * xterm.c: Likewise.
10557         * atimer.c: Omit needless casts.
10558         * buffer.c: Likewise.
10559         * callproc.c: Likewise.
10560         * ccl.c: Likewise.
10561         * coding.c: Likewise.
10562         * composite.c: Likewise.
10563         * doc.c: Likewise.
10564         * doprnt.c: Likewise.
10565         * editfns.c: Likewise.
10566         * emacs.c: Likewise.
10567         * eval.c: Likewise.
10568         * filelock.c: Likewise.
10569         * fns.c: Likewise.
10570         * gtkutil.c: Likewise.
10571         * keyboard.c: Likewise.
10572         * lisp.h: Likewise.
10573         * lread.c: Likewise.
10574         * minibuf.c: Likewise.
10575         * msdos.c: Likewise.
10576         * print.c: Likewise.
10577         * process.c: Likewise.
10578         * region-cache.c: Likewise.
10579         * search.c: Likewise.
10580         * sysdep.c: Likewise.
10581         * termcap.c: Likewise.
10582         * terminal.c: Likewise.
10583         * tparam.c: Likewise.
10584         * w16select.c: Likewise.
10585         * w32.c: Likewise.
10586         * w32reg.c: Likewise.
10587         * w32select.c: Likewise.
10588         * w32uniscribe.c: Likewise.
10589         * widget.c: Likewise.
10590         * xdisp.c: Likewise.
10591         * xmenu.c: Likewise.
10592         * xrdb.c: Likewise.
10593         * xselect.c: Likewise.
10595 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
10597         * fileio.c (time_error_value): Check the right error number.
10598         Problem reported by Troels Nielsen in
10599         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10601 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
10603         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10604         This should be fixed in a better way; see Eli Zaretskii in
10605         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10606         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10608         * fileio.c (time_error_value): Rename from special_mtime.
10609         The old name's problems were noted by Eli Zaretskii in
10610         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10612         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10613         This variable's comment says Emacs needs at least one GDB-visible
10614         symbol of type enum pvec_type, to work around GDB problems.
10615         The symbol's value doesn't matter.
10617         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10618         that causes compilation to fail on pre-C99 compilers.
10620 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
10622         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10623         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10625 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
10627         * buffer.c (init_buffer_once): Fix initialization of
10628         headers for buffer_defaults and buffer_local_symbols.
10629         Reported by Juanma Barranquero <lekktu@gmail.com>.
10631 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
10633         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10634         * lisp.h (enum pvec_type): Use fewer bits.
10635         (PSEUDOVECTOR_SIZE_BITS): New constant.
10636         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10637         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10638         change in pvec_type.
10639         (PSEUDOVECTOR_TYPEP): New macro.
10640         (TYPED_PSEUDOVECTORP): Use it.
10641         * fns.c (internal_equal): Adapt code to extract pvectype.
10642         * emacs.c (gdb_pvec_type): Update type.
10643         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10644         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10645         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10646         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10647         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
10648         abusing vector->header.next.nbytes.
10649         (live_vector_p): Use PVEC_TYPE.
10650         (mark_object): Adapt code to extract pvectype.  Use switch.
10652 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
10654         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10655         Tighten new eassert a bit.
10657 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
10659         Fix compilation with --enable-gcc-warnings and -O1
10660         optimization level.
10661         * doprnt.c (doprnt): Change type of tem to int, initialize
10662         to avoid compiler warning.  Add eassert.
10663         * search.c (simple_search): Initialize match_byte to avoid
10664         compiler warning.  Add eassert.
10666 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
10668         Avoid weird behavior with large horizontal scrolls.
10669         Without this change, for example, large hscroll values would
10670         mess up Emacs's display on Fedora 15 x86, presumably due to
10671         overflows in int calculations in the display code.
10672         Also, if buffers had long lines, Emacs would freeze.
10673         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10674         (set_window_hscroll): New function, containing the old guts of
10675         Fset_window_hscroll.  Return the clipped value.
10676         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10677         This avoids the need to check against PTRDIFF_MAX.
10679         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10681 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
10683         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10685 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
10687         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
10688         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10689         since GCC 4.4.6 issues a bogus warning for them.
10691         Fix bugs in file timestamp newness comparisons.
10692         * fileio.c (Ffile_newer_than_file_p):
10693         * lread.c (Fload): Use full timestamp resolution of files,
10694         not just the 1-second resolution, so that files that are only
10695         slightly newer still count as newer.
10696         * fileio.c (Ffile_newer_than_file_p): Don't assume file
10697         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10699 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
10701         * fileio.c: Improve handling of file time marker.  (Bug#11852)
10702         (special_mtime): New function.
10703         (Finsert_file_contents, Fverify_visited_file_modtime):
10704         Use it to set special mtime values consistently.
10706 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
10708         * fileio.c (Finsert_file_contents): Properly handle st_mtime
10709         marker for non-existing file.  (Bug#11852)
10711 2012-07-03  Glenn Morris  <rgm@gnu.org>
10713         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10714         and did not make it into globals.h).
10716 2012-07-03  Tom Tromey  <tromey@redhat.com>
10718         * window.c (Fset_window_margins, Fset_window_fringes)
10719         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10720         * textprop.c (Fprevious_property_change): No longer static.
10721         * syntax.c (Fsyntax_table_p): No longer static.
10722         * process.c (Fget_process, Fprocess_datagram_address): No longer
10723         static.
10724         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10725         * keyboard.c (Fcommand_execute): No longer static.
10726         Remove EXFUN.
10727         * insdel.c (Fcombine_after_change_execute): No longer static.
10728         * image.c (Finit_image_library): No longer static.
10729         * fileio.c (Fmake_symbolic_link): No longer static.
10730         * eval.c (Ffetch_bytecode): No longer static.
10731         * editfns.c (Fuser_full_name): No longer static.
10732         * doc.c (Fdocumentation_property, Fsnarf_documentation):
10733         No longer static.
10734         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10735         static.
10736         * dired.c (Ffile_attributes): No longer static.
10737         * composite.c (Fcomposition_get_gstring): No longer static.
10738         * callproc.c (Fgetenv_internal): No longer static.
10740         * ccl.h: Remove EXFUNs.
10741         * buffer.h: Remove EXFUNs.
10742         * dispextern.h: Remove EXFUNs.
10743         * intervals.h: Remove EXFUNs.
10744         * fontset.h: Remove EXFUN.
10745         * font.h: Remove EXFUNs.
10746         * dosfns.c (system_process_attributes): Remove EXFUN.
10747         * keymap.h: Remove EXFUNs.
10748         * lisp.h: Remove EXFUNs.
10749         * w32term.h: Remove EXFUNs.
10750         * window.h: Remove EXFUNs.
10751         * xsettings.h: Remove EXFUN.
10752         * xterm.h: Remove EXFUN.
10754 2012-07-03  Glenn Morris  <rgm@gnu.org>
10756         * lisp.h (Frandom): Make it visible to C.
10757         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10758         buffer for invisible buffers.  (Bug#1229)
10760 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
10762         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10763         values which aren't power of 2.
10764         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
10765         Verify its value and the value of VECTOR_BLOCK_SIZE.  Adjust users
10766         accordingly.
10768 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
10770         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10772         * alloc.c (mark_object): Revert part of last patch to use `switch'.
10774 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
10776         * alloc.c (allocate_vector_block): Remove redundant
10777         calls to mallopt if DOUG_LEA_MALLOC is defined.
10778         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10779         avoid calls to mallopt if zero_vector is returned.
10781 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
10783         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10784         is enabled, avoid dereferencing NULL current_sblock if
10785         running undumped.
10787 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
10789         Cleanup basic buffer management.
10790         * buffer.h (struct buffer): Change layout to use generic vector
10791         marking code.  Fix some comments.  Change type of 'clip_changed'
10792         to bitfield.  Remove unused #ifndef old.
10793         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10794         (GET_OVERLAYS_AT): Fix indentation.
10795         (for_each_per_buffer_object_at): New macro.
10796         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10797         (Fbuffer_local_variables): Use it.
10798         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10799         * alloc.c (allocate_buffer): Adjust to match new layout of
10800         struct buffer.  Fix comment.
10801         (mark_overlay): New function.
10802         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
10803         Lisp area of struct buffer.
10804         (mark_object): Use it.  Adjust marking of misc objects
10805         and related comments.
10807 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
10809         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10810         wrapper that is not needed because the wrapped code is a no-op (zero
10811         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10812         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10814 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
10816         * alloc.c (mark_buffer): Simplify.  Remove prototype.
10817         (mark_object): Add comment.  Reorganize marking of vector-like
10818         objects.  Use CHECK_LIVE for all vector-like objects except buffers
10819         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10820         Avoid redundant calls to mark_vectorlike for bool vectors.
10822 2012-06-30  Glenn Morris  <rgm@gnu.org>
10824         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10826         * epaths.in (PATH_SITELOADSEARCH): New.
10827         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10828         This is rather than relying on --enable-locallisppath elements
10829         having "site-lisp" in their names.  (Bug#10208#25, 11658)
10831 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
10833         * w32proc.c (sys_select): Accept and ignore one more argument.
10835         * w32.c (emacs_gnutls_pull): Call select with one more argument.
10837         * sysselect.h [DOS_NT]: Don't include sys/select.h.
10838         (pselect) [!MS_DOS]: Redirect to sys_select.
10840         * sysdep.c: Don't include dos.h and dosfns.h.
10842         * process.c (sys_select):
10843         * msdos.c (sys_select): Accept one more argument and ignore it.
10845         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10846         adapt data types and code to that.
10848         * dosfns.c:
10849         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10850         which clashes with the gnulib function of the same name.
10852 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
10854         * font.c (font_style_to_value, font_style_symbolic)
10855         (font_prop_validate_style): Add type checks for values in
10856         font_style_table.
10858         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10859         argument.
10860         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10861         uses.
10863 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
10865         * xdisp.c (try_window_id): Undo last change.
10867         * w32.c (getwd): Adjust commentary about startup_dir.
10868         (init_environment): Always call sys_access, even in non-MSVC
10869         builds.  Don't chdir to the directory of the Emacs executable.
10870         This undoes code from 1997 which was justified by the need to
10871         "avoid conflicts when removing and renaming directories".  But its
10872         downside was that every relative file name was being interpreted
10873         relative to the directory of the Emacs executable, which can never
10874         be TRT.  In particular, it broke sys_access when called with
10875         relative file names.
10876         (sys_access): Map GetLastError to errno.
10878 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
10880         * window.h (struct window): Change type of 'fringes_outside_margins'
10881         to bitfield.  Fix comment.  Adjust users accordingly.
10882         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
10883         Adjust comment.
10884         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10885         to ptrdiff_t.
10887 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
10889         * gnutls.c (emacs_gnutls_handshake):
10890         Add QUIT to make the loop interruptible.
10892 2012-06-29  Glenn Morris  <rgm@gnu.org>
10894         * charset.c (init_charset): Make lack of etc/charsets fatal.
10896 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
10898         * editfns.c (region_limit): Fix type mismatch.
10900 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
10902         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10903         undefined.  Convert from xassert to eassert.
10904         * nsmenu.m: Convert from xassert to eassert.
10905         * nsterm.m: Likewise.
10907 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
10909         * editfns.c (region_limit): Clip to narrowing (bug#11770).
10911 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
10913         Avoid integer overflow on scroll-left and scroll-right.
10914         * window.c (HSCROLL_MAX): New macro.
10915         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10916         overflow when requested scroll falls outside ptrdiff_t range.
10918 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
10920         * window.h (struct window): Change type of 'hscroll',
10921         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10922         'last_modified' and 'last_overlay_modified' to EMACS_INT.
10923         Adjust users accordingly.
10924         * xdisp.c (try_cursor_movement): Replace type check with eassert.
10925         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10926         from EMACS_INT to ptrdiff_t.
10927         (make_window): Omit redundant initialization.
10929 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
10931         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10933 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
10935         * window.h (struct window): Change type of 'use_time' and
10936         'sequence_number' from Lisp_Object to int.
10937         * frame.c (make_frame): Adjust users accordingly.
10938         * print.c (print_object): Likewise.
10939         * window.c (select_window, Fwindow_use_time, make_parent_window)
10940         (make_window): Likewise.
10942 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
10944         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10945         enabled with --enable-checking=[all,glyphs] configure option.
10946         Fix GLYPH_DEBUG usage assuming that it may be undefined,
10947         adjust comments accordingly.
10948         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10949         undefined, adjust comments accordingly.
10950         * image.c: Likewise.
10951         * scroll.c: Likewise.
10952         * w32fns.c: Likewise.
10953         * w32term.c: Likewise.
10954         * xdisp.c: Likewise.
10955         * xfaces.c: Likewise.
10956         * xfns.c: Likewise.
10957         * xterm.c: Likewise.
10959 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
10961         Generalize run-time debugging checks.
10962         * dispextern.h (XASSERTS): Remove.
10963         * fontset.c (xassert): Remove.
10964         Convert from xassert to eassert.
10965         * alloc.c: Convert from xassert to eassert.
10966         * bidi.c: Likewise.
10967         * dispnew.c: Likewise.
10968         * fns.c: Likewise.
10969         * fringe.c: Likewise.
10970         * ftfont.c: Likewise.
10971         * gtkutil.c: Likewise.
10972         * image.c: Likewise.
10973         * keyboard.c: Likewise.
10974         * menu.c: Likewise.
10975         * process.c: Likewise.
10976         * scroll.c: Likewise.
10977         * sound.c: Likewise.
10978         * term.c: Likewise.
10979         * w32console.c: Likewise.
10980         * w32fns.c: Likewise.
10981         * w32term.c: Likewise.
10982         * window.c: Likewise.
10983         * xdisp.c: Likewise.
10984         * xfaces.c: Likewise.
10985         * xfns.c: Likewise.
10986         * xselect.c: Likewise.
10987         * xterm.c: Likewise.
10989 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
10991         * fns.c (maybe_resize_hash_table): Output message when growing the
10992         purify-hashtable.
10994 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
10996         * alloc.c (allocate_string_data): Remove dead code.
10997         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10998         avoid GCC warning about unused macro.
11000 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
11002         * alloc.c (allocate_string): Omit intervals initialization.
11003         * alloc.c (make_uninit_multibyte_string): Initialize intervals
11004         as in make_pure_string and make_pure_c_string.
11006 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
11008         * alloc.c (allocate_string): Fix last change.
11010 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
11012         * alloc.c (allocate_string): Remove two redundant calls
11013         to memset, add explicit initialization where appropriate.
11015 2012-06-27  Glenn Morris  <rgm@gnu.org>
11017         * lisp.mk (lisp): Remove paths.elc.
11019 2012-06-27  Chong Yidong  <cyd@gnu.org>
11021         * doc.c (Fsubstitute_command_keys): Fix punctuation.
11023 2012-06-26  John Wiegley  <johnw@newartisans.com>
11025         * unexmacosx.c (copy_data_segment): Add two section names used
11026         on Mac OS X Lion: __mod_init_func and __mod_term_func.
11028         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11029         when building with Clang.
11031 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
11033         * eval.c (Fapply): Allow calling it with a single argument.
11035 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
11037         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11038         _stricmp and _strnicmp.
11039         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11041 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
11043         * alloc.c (allocate_window): Zero out non-Lisp part of newly
11044         allocated window.
11045         (allocate_process): Likewise for new process.
11046         (allocate_terminal): Change to use offsetof.
11047         (allocate_frame): Likewise.
11048         * frame.c (make_frame): Omit redundant initialization.
11049         * window.c (make_parent_window): Use memset.
11050         (make_window): Omit redundant initialization.
11051         * process.c (make_process): Omit redundant initialization.
11052         * terminal.c (create_terminal): Likewise.
11054 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
11056         * term.c (delete_tty): Remove redundant call to memset.
11058 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
11060         * alloc.c: Remove build_string.
11061         * lisp.h: Define build_string as static inline.  This provides
11062         a better opportunity to optimize away calls to strlen when the
11063         function is called with compile-time constant argument.
11064         * image.c (imagemagick_error): Convert to build_string.
11065         * w32proc.c (sys_spawnve): Likewise.
11066         * xterm.c (x_term_init): Likewise.
11068 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
11070         Use sprintf return value instead of invoking strlen on result.
11071         In the old days this wasn't portable, since some sprintf
11072         implementations returned char *.  But they died out years ago and
11073         Emacs already assumes sprintf returns int.
11074         Similarly for float_to_string.
11075         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11076         * ccl.c (ccl_driver):
11077         * character.c (string_escape_byte8):
11078         * data.c (Fnumber_to_string):
11079         * doprnt.c (doprnt):
11080         * print.c (print_object):
11081         * xdisp.c (message_dolog):
11082         * xfns.c (syms_of_xfns):
11083         Use sprintf or float_to_string result to avoid need to call strlen.
11084         * data.c (Fnumber_to_string):
11085         Use make_unibyte_string, since the string must be ASCII.
11086         * lisp.h, print.c (float_to_string): Now returns int length.
11087         * term.c (produce_glyphless_glyph):
11088         Use sprintf result rather than recomputing it.
11090         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11091         * Makefile.in (ALL_CFLAGS):
11092         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11093         * gmalloc.c, regex.c: Include <config.h> unconditionally.
11095 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
11097         * dispextern.h (xstrcasecmp): Define to library function
11098         strcasecmp if available.
11099         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11101 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
11103         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11104         Avoid comma operator.
11105         * menu.c (push_submenu_start, push_submenu_end)
11106         (push_left_right_boundary, push_menu_pane): Likewise.
11107         * msdos.c (dos_rawgetc): Likewise.
11109 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
11111         * xfns.c (xic_create_fontsetname): Remove redundant calls
11112         to memset.
11114 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
11116         * gtkutil.c (get_utf8_string): Remove redundant assignment.
11117         sprintf already null-terminates its output.
11119         * xfns.c (x_window): Remove redundant cast.
11121 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
11123         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11124         `const char *' to `char *' to avoid compiler warning.
11126 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
11128         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11129         instead of truncating it to 63 (admittedly a generous limit).
11131         * process.c: Fix spelling and caps in comments.
11133 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
11135         * emacs.c (setpgrp): Remove definition, unused.
11136         * sysdep.c (setpgrp): Remove definition, not used in this file.
11138 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
11140         * makefile.w32-in: Update dependencies.
11142 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
11144         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11145         (SYSTIME_H): Add nt/inc/sys/time.h.
11147         * systime.h [WINDOWSNT]: Include sys/time.h.
11149         * s/ms-w32.h (struct timespec): Definition moved from
11150         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11152 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
11154         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11155         * buffer.h (buffer_slot_type_mismatch):
11156         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11157         * eval.c (unwind_to_catch):
11158         * image.c (my_png_error, my_error_exit):
11159         * keyboard.c (quit_throw_to_read_char, user_error)
11160         (Fexit_recursive_edit, Fabort_recursive_edit):
11161         * lisp.h (die, args_out_of_range, args_out_of_range_3)
11162         (wrong_type_argument, buffer_overflow, __executable_start)
11163         (memory_full, buffer_memory_full, string_overflow, Fthrow)
11164         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11165         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11166         (fatal):
11167         (child_setup) [!DOS_NT]:
11168         * lread.c (end_of_file_error, invalid_syntax):
11169         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11170         * puresize.h (pure_write_error):
11171         * search.c (matcher_overflow):
11172         * sound.c (sound_perror, alsa_sound_perror):
11173         * sysdep.c, syssignal.h (croak):
11174         * term.c (maybe_fatal, vfatal):
11175         * textprop.c (text_read_only):
11176         * undo.c (user_error):
11177         * unexmacosx.c (unexec_error):
11178         * xterm.c (x_ins_del_lines, x_delete_glyphs):
11179         Use _Noreturn rather than NO_RETURN.
11180         No need for separate decl merely because of _Noreturn.
11181         * sound.c (sound_warning, parse_sound):
11182         Remove unnecessary forward decls.
11184 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
11186         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11187         * lisp.h (WAIT_READING_MAX): New macro.
11188         * dispnew.c (Fsleep_for, sit_for):
11189         * keyboard.c (kbd_buffer_get_event):
11190         * process.c (Faccept_process_output):
11191         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11192         This improves on the previous patch, which introduced a bug
11193         when time_t is unsigned and as wide as intmax_t.
11194         See <http://bugs.gnu.org/9000#51>.
11196 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
11198         * dispnew.c (sit_for, Fsleep_for):
11199         * keyboard.c (kbd_buffer_get_event):
11200         * process.c (Faccept_process_output): Avoid compiler warnings when
11201         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11203 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
11205         * makefile.w32-in: Update dependencies.
11207         * w32.c (ltime): Add return type and declare static.
11208         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11210 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
11212         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11213         Privately reported by Herbert J. Skuhra.
11214         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11215         All uses changed.
11216         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11217         not make_lisp_timeval, when the argument is of type EMACS_TIME.
11219 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
11221         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11222         last argument of make_unibyte_string.
11224         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11225         language ID in the event parameters.
11227         * w32term.c (w32_read_socket): Put the new keyboard codepage into
11228         event.code, not the obscure "character set ID".
11230 2012-06-23  Chong Yidong  <cyd@gnu.org>
11232         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11234 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
11236         Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11237         * w32.c (fdutimens): New function.
11239         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11241         * s/ms-w32.h (pselect): Redirect to sys_select.
11243         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11245         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11246         in the logic of incrementing and decrementing the value of
11247         use_relocatable_buffers.
11249 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
11251         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11252         Privately reported by Herbert J. Skuhra.
11253         [__FreeBSD__]: Remove "*/" typo after "#include".
11254         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11255         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11256         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11257         Don't assume EMACS_TIME and struct timeval are the same type.
11259 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
11261         Support higher-resolution time stamps (Bug#9000).
11262         The time stamps are only nanosecond-resolution at the C level,
11263         since that's the best that any real-world system supports now.
11264         But they are picosecond-resolution at the Lisp level, as that's
11265         easy, and leaves room for future OS improvements.
11267         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11268         (LIBES): Use it.
11270         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11271         Don't get current time unless it's needed.
11273         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11274         now provides it if it's absent.
11275         (start_atimer): Port to higher-res time stamps.
11276         Check for time stamp overflow.  Don't get current time more
11277         often than is needed.
11279         * buffer.h (struct buffer): Buffer modtime now has high resolution.
11280         Include systime.h, not time.h.
11281         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11283         * dired.c: Include stat-time.h.
11284         (Ffile-attributes): File times now have higher resolution.
11286         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11287         (struct image): Timestamp now has higher resolution.
11289         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11290         has at least microseconds now.  All uses removed.
11291         (update_frame, update_single_window, update_window, update_frame_1)
11292         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
11293         (duration_to_sec_usec): Remove; no longer needed.
11295         * editfns.c (time_overflow): Now extern.
11296         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11297         (float-time, Fformat_time_string, Fcurrent_time_string)
11298         (Fcurrent_time_zone): Accept and generate higher-resolution
11299         time stamps.
11300         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11301         (decode_time_components, lisp_seconds_argument): New functions.
11302         (make_time): Now static.
11303         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
11304         Report an error if the time is invalid, rather than having the caller
11305         do that.
11307         * fileio.c: Include <stat-time.h>
11308         (Fcopy_file): Copy higher-resolution time stamps.
11309         Prefer to set the time stamp via a file descriptor if that works.
11310         (Fset_file_times, Finsert_file_contents, Fwrite_region)
11311         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11312         (Fvisited_file_modtime, Fset_visited_file_modtime):
11313         Support higher-resolution time stamps.
11315         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11317         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11319         * image.c (prepare_image_for_display, clear_image_cache)
11320         (lookup_image): Port to higer-resolution time stamps.
11322         * keyboard.c (start_polling, bind_polling_period):
11323         Check for time stamp overflow.
11324         (read_char, kbd_buffer_get_event, timer_start_idle)
11325         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11326         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11327         Port to higher-resolution time stamps.  Do not assume time_t is signed.
11328         (decode_timer): New function.  Timers are now vectors of length 9,
11329         not 8, to accommodate the picosecond component.
11330         (timer_check_2): Use it.
11332         * nsterm.m (select_timeout, timeval_subtract): Remove.
11333         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11334         as they're a bit more accurate and handle overflow better.
11335         (ns_select): Change prototype to be compatible with pselect.
11336         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11337         * nsterm.h (ns_select): Adjust prototype.
11339         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11340         us-resolution time stamps.
11341         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11343         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11345         * lisp.h (time_overflow): New decl.
11346         (wait_reading_process_output): First arg is now intmax_t, not int,
11347         to accommodate larger waits.
11349         * process.h (struct Lisp_Process.read_output_delay):
11350         Now counts nanoseconds, not microseconds.
11351         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11352         EMACS_HAS_USECS.
11353         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11354         (wait_reading_process_output):
11355         Port to ns-resolution time stamps.
11356         (Faccept_process_output, wait_reading_process_output):
11357         Check for time stamp overflow.  Do not assume time_t is signed.
11358         (select_wrapper): Remove; we now use pselect.
11359         (Fprocess_attributes): Now generates ns-resolution time stamps.
11361         * sysdep.c: Include utimens.h.  Don't include utime.h
11362         or worry about struct utimbuf; gnulib does that for us now.
11363         (gettimeofday): Remove; gnulib provides a substitute.
11364         (make_timeval): New function.
11365         (set_file_times): Now sets ns-resolution time stamps.
11366         New arg FD; all uses changed.
11367         (time_from_jiffies, ltime_from_jiffies, get_up_time)
11368         (system_process_attributes):
11369         Now returns ns-resolution time stamp.  All uses changed.
11370         Check for time stamp overflow.
11372         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11373         provides a substitute now.
11375         * systime.h: Include timespec.h rather than sys/time.h and time.h,
11376         since it guarantees struct timespec.
11377         (EMACS_TIME): Now struct timespec, so that we can support
11378         ns-resolution time stamps.
11379         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11380         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11381         (EMACS_USECS): Remove.
11382         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11383         so multiply the arg by 1000 before storing it.
11384         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11385         New macros.
11386         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11387         Port to ns-resolution time stamps.
11388         (EMACS_TIME_NEG_P): Remove; replaced by....
11389         (EMACS_TIME_SIGN): New macro.
11390         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11391         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11392         (set_file_times, make_time, lisp_time_argument): Adjust signature.
11393         (make_timeval, make_lisp_time, decode_time_components): New decls.
11394         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
11395         that it mishandled time_t overflow.  You can't compare by subtracting!
11396         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11397         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11399         * term.c: Include <sys/time.h>.
11400         (timeval_to_Time): New function, for proper overflow wraparound.
11401         (term_mouse_position, term_mouse_click): Use it.
11403         * undo.c (record_first_change): Support higher-resolution time stamps
11404         in the undo buffer.
11405         (Fprimitive_undo): Use them when restoring time stamps.
11407         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11408         (w32_get_internal_run_time):
11409         Port to higher-resolution Emacs time stamps.
11410         (ltime): Now accepts single 64-bit integer, as that's more convenient
11411         for callers.
11413         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11415         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11416         for compatibility with pselect.  Support ns-resolution time stamps.
11418         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11420         * xselect.c (wait_for_property_change, x_get_foreign_selection):
11421         Check for time stamp overflow, and support ns-resolution time stamps.
11423         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11424         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11425         (timeval_subtract): Remove; no longer needed.
11426         (XTflash, XTring_bell, x_wait_for_event):
11427         Port to ns-resolution time stamps.  Don't assume time_t is signed.
11429 2012-06-22  Chong Yidong  <cyd@gnu.org>
11431         * xdisp.c (x_consider_frame_title): Revert last change.
11433 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
11435         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
11436         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11437         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
11438         staticidx goes up to 1597 out of 1600 = 0x640.)
11440 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
11442         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11443         Otherwise, the umask might be mistakenly 0 while handling input signals.
11445 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
11447         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11449 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
11451         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11452         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11453         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11454         access to `contents' member of Lisp_Vector objects with AREF and ASET
11455         where appropriate.
11457 2012-06-19  Chong Yidong  <cyd@gnu.org>
11459         * frame.c (delete_frame): When selecting a frame on a different
11460         text terminal, do not alter the terminal's top-frame.
11462         * xdisp.c (format_mode_line_unwind_data): Record the target
11463         frame's selected window and its terminal's top-frame.
11464         (unwind_format_mode_line): Restore them.
11465         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11466         Callers changed.
11467         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11468         since tty frames can be explicitly named.
11469         (prepare_menu_bars): Likewise.
11471         * term.c (Ftty_top_frame): New function.
11473 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
11475         Port byte-code-meter to modern targets.
11476         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11477         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
11478         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
11479         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11480         (METER_1, METER_2): Simplify.
11482 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
11484         * data.c (Fdefalias): Return `symbol' (bug#11686).
11486 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
11488         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
11489         gets killed during executing of this function (Bug#11665).
11490         Try to always return Qt when the buffer has been actually killed.
11491         (Vkill_buffer_query_functions): In doc-string say that functions
11492         run by this hook should not change the current buffer.
11494 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
11496         Fix recently-introduced process.c problems found by static checking.
11497         * process.c (write_queue_push, write_queue_pop, send_process):
11498         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11499         (write_queue_pop): Fix pointer signedness problem.
11500         (send_process): Remove unused local.
11502 2012-06-17  Chong Yidong  <cyd@gnu.org>
11504         * xdisp.c (redisplay_internal): No need to redisplay terminal
11505         frames that are not on top.
11507 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
11509         * process.c (make_process): Initialize write_queue.
11510         (write_queue_push, write_queue_pop): New functions.
11511         (send_process): Use them to maintain correct ordering of process
11512         writes (Bug#10815).
11514 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
11516         * lisp.h (eassert): Assume C89 or later.
11517         This removes the need for CHECK.
11518         (CHECK): Remove.  Its comments about always evaluating its
11519         argument were confusing, as 'eassert' typically does not evaluate
11520         its argument.
11522         * coding.c (produce_chars): Use ptrdiff_t, not int.
11524         * xterm.c (x_draw_underwave): Check for integer overflow.
11525         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11527 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
11529         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11530         referenced (Bug#11583).
11532 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
11534         Implement wave-style variant of underlining.
11535         * dispextern.h (face_underline_type): New enum.
11536         (face): Add field for underline type.
11537         * nsterm.m (ns_draw_underwave): New function.
11538         (ns_draw_text_decoration): Use it.
11539         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11540         New functions.
11541         (x_draw_glyph_string): Use them.
11542         * xfaces.c (Qline, Qwave): New Lisp objects.
11543         (check_lface_attrs, merge_face_ref)
11544         (Finternal_set_lisp_face_attribute, realize_x_face):
11545         Handle wave-style underline face attributes.
11546         * xterm.c (x_draw_underwave): New function.
11547         (x_draw_glyph_string): Use it.
11549 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
11551         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11552         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11553         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11554         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11555         ($(BLD)/w32select.$(O)): Update dependencies.
11557 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
11559         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11560         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11561         * character.c (_fetch_multibyte_char_p): Remove.
11562         * alloc.c: Include "character.h" before "buffer.h".
11563         * bidi.c: Likewise.
11564         * buffer.c: Likewise.
11565         * bytecode.c: Likewise.
11566         * callint.c: Likewise.
11567         * callproc.c: Likewise.
11568         * casefiddle.c: Likewise.
11569         * casetab.c: Likewise.
11570         * category.c: Likewise.
11571         * cmds.c: Likewise.
11572         * coding.c: Likewise.
11573         * composite.c: Likewise.
11574         * dired.c: Likewise.
11575         * dispnew.c: Likewise.
11576         * doc.c: Likewise.
11577         * dosfns.c: Likewise.
11578         * editfns.c: Likewise.
11579         * emacs.c: Likewise.
11580         * fileio.c: Likewise.
11581         * filelock.c: Likewise.
11582         * font.c: Likewise.
11583         * fontset.c: Likewise.
11584         * fringe.c: Likewise.
11585         * indent.c: Likewise.
11586         * insdel.c: Likewise.
11587         * intervals.c: Likewise.
11588         * keyboard.c: Likewise.
11589         * keymap.c: Likewise.
11590         * lread.c: Likewise.
11591         * macros.c: Likewise.
11592         * marker.c: Likewise.
11593         * minibuf.c: Likewise.
11594         * nsfns.m: Likewise.
11595         * nsmenu.m: Likewise.
11596         * print.c: Likewise.
11597         * process.c: Likewise.
11598         * regex.c: Likewise.
11599         * region-cache.c: Likewise.
11600         * search.c: Likewise.
11601         * syntax.c: Likewise.
11602         * term.c: Likewise.
11603         * textprop.c: Likewise.
11604         * undo.c: Likewise.
11605         * unexsol.c: Likewise.
11606         * w16select.c: Likewise.
11607         * w32fns.c: Likewise.
11608         * w32menu.c: Likewise.
11609         * window.c: Likewise.
11610         * xdisp.c: Likewise.
11611         * xfns.c: Likewise.
11612         * xmenu.c: Likewise.
11613         * xml.c: Likewise.
11614         * xselect.c: Likewise.
11616 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
11618         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11619         If all the glyphs of the glyph row came from strings, and we have no
11620         cursor positioning clues, put the cursor on the first glyph of the
11621         row.
11622         (handle_face_prop): Use chunk-relative overlay string index when
11623         indexing into it->string_overlays array.  (Bug#11653)
11624         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11625         the rightmost.  (Bug#11720)
11627 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
11629         * category.h (CHAR_HAS_CATEGORY): Define as inline.
11630         (CATEGORY_MEMBER): Enforce 1/0 value.
11631         * category.c (_temp_category_set): Remove.
11633 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
11635         * window.c (Fdelete_other_windows_internal)
11636         (Fdelete_window_internal): Don't access frame's mouse highlight
11637         info of the initial frame.  (Bug#11677)
11639 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
11641         * .gdbinit (xgetint): Fix recently-introduced paren typo.
11642         Assume USE_2_TAGS_FOR_INTS.
11643         (xreload): Adjust $tagmask width to match recent lisp.h change.
11645         Simplify lisp.h in minor ways that should not affect code.
11646         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11647         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11648         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11649         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11650         (INTTYPEBITS): New macro, for clarity.
11651         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
11652         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11653         Simplify now that USE_LSB_TAG is always defined.
11654         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11655         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11657 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
11659         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11661 2012-06-13  Glenn Morris  <rgm@gnu.org>
11663         * s/bsd-common.h (BSD4_3):
11664         * s/usg5-4-common.h (USG5_4): No longer define; unused.
11666 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
11668         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11669         instead of union.
11670         (XLI, XIL): Define.
11671         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11672         Use them.
11673         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
11674         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
11675         * alloc.c (widen_to_Lisp_Object): Remove.
11676         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11677         * frame.c (delete_frame): Remove outdated comment.
11678         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11679         USE_LISP_UNION_TYPE.
11680         (Fw32_unregister_hot_key): Likewise.
11681         (Fw32_toggle_lock_key): Likewise.
11682         * w32menu.c (add_menu_item): Likewise.
11683         (w32_menu_display_help): Use XIL instead of checking
11684         USE_LISP_UNION_TYPE.
11685         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11686         (init_heap): Likewise.
11687         * w32term.c (w32_read_socket): Update comment.
11689 2012-06-13  Glenn Morris  <rgm@gnu.org>
11691         * s/usg5-4-common.h, src/s/unixware.h:
11692         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11694         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11696 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
11698         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11699         * alloc.c (make_number) [!defined make_number]:
11700         Remove, as lisp.h always defines this now.
11701         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11702         (roundup_size): Verify that it is a power of 2.
11703         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11704         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11705         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11706         -DUSE_LSB_TAG=0, to override the automatically-selected default.
11707         USE_LSB_TAG now is always defined to be either 0 or 1.
11708         All uses changed.
11709         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11710         code works fine either way, and efficiency is not a concern here,
11711         as the union type is for debugging, not for production.
11712         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11713         Use an inline function on all platforms when using the union type,
11714         since this is simpler and 'static inline' can be used portably
11715         within Emacs now.
11716         (LISP_INITIALLY_ZERO): New macro.
11717         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11718         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11720 2012-06-12  Glenn Morris  <rgm@gnu.org>
11722         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11724         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
11726         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11727         Move BROKEN_SIGIO to configure.
11729         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11730         Move NO_TERMIO to configure.
11732 2012-06-12  Chong Yidong  <cyd@gnu.org>
11734         * image.c (imagemagick_load_image): Use MagickFlattenImage if
11735         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
11736         MagickExportImagePixels is undefined.
11738 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
11740         * image.c (imagemagick_load_image): Remove unused label.
11742 2012-06-11  Glenn Morris  <rgm@gnu.org>
11744         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11745         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11746         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11747         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11749 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
11751         * alloc.c (make_byte_code): New function.
11752         (Fmake_byte_code): Use it.  Don't purify here.
11753         * lread.c (read1): Use it as well to avoid extra allocation.
11755 2012-06-11  Chong Yidong  <cyd@gnu.org>
11757         * image.c (imagemagick_load_image): Implement transparency.
11759 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
11761         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11762         account for preceding backslashes.  (Bug#11663)
11764 2012-06-09  Chong Yidong  <cyd@gnu.org>
11766         * term.c: Support italics in capable terminals (Bug#9652).
11767         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11768         (turn_on_face): Output using TS_enter_italic_mode if available.
11769         Don't handle unused blinking and alt-charset cases.
11770         (turn_off_face): Handle italic case; discard unused tty_blinking_p
11771         and tty_alt_charset_p cases.
11772         (tty_capable_p, init_tty): Support italics.
11774         * termchar.h (struct tty_display_info): Add field for italics.
11775         Remove unused blink field.
11777         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11778         Handle slant.
11780         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11781         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11782         tty_alt_charset_p.  Add tty_italic_p.
11784 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
11786         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11787         dbus_type_is_basic if available.
11788         (xd_extract_signed, xd_extract_unsigned): Rename from
11789         extract_signed and extract_unsigned, respectively.  Adapt callers.
11791 2012-06-09  Chong Yidong  <cyd@gnu.org>
11793         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11795         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11796         case (Bug#9752).
11798 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
11800         * xdisp.c (vmessage): Treat frame message as multibyte.
11801         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11802         would generate the diagnostic "Making \302\247 buffer-local while
11803         let-bound!".
11805 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
11807         * dispnew.c (showing_window_margins_p): Undo last change, which
11808         was done due to an inadvertent commit.
11809         (adjust_frame_glyphs_for_frame_redisplay): Do call
11810         showing_window_margins_p.
11812 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
11814         * eval.c (Fmake_var_non_special): New primitive.
11815         (syms_of_eval): Defsubr it.
11816         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11818 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
11820         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11821         function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11823 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
11825         * alloc.c (allocate_vectorlike): Fix last change.
11827 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
11829         Block-based vector allocation of small vectors.
11830         * lisp.h (struct vectorlike_header): New field `nbytes',
11831         adjust comment accordingly.
11832         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
11833         to denote vector blocks.  Adjust users (live_vector_p,
11834         mark_maybe_pointer, valid_lisp_object_p) accordingly.
11835         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11836         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11837         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11838         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11839         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11840         (roundup_size): New constant.
11841         (struct vector_block): New data type.
11842         (vector_blocks, vector_free_lists, zero_vector): New variables.
11843         (all_vectors): Rename to `large_vectors'.
11844         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11845         (sweep_vectors): New functions.
11846         (allocate_vectorlike): Return `zero_vector' as the only vector of
11847         0 items.  Allocate new vector from block if vector size is less than
11848         or equal to VBLOCK_BYTES_MAX.
11849         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11850         (init_alloc_once): Add call to init_vectors.
11852 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
11854         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11856 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
11858         * doprnt.c (doprnt): Truncate multibyte char correctly.
11859         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11860         would mishandle a string argument "Xc" if X was a multibyte
11861         character of length 2: it would truncate after X's first byte
11862         rather than including all of X.
11864 2012-06-06  Chong Yidong  <cyd@gnu.org>
11866         * buffer.c (word_wrap): Doc fix.
11868 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
11870         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11872 2012-06-03  Glenn Morris  <rgm@gnu.org>
11874         * xdisp.c (tool-bar-style): Doc fix.
11876 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
11878         * Makefile.in (PAXCTL): Define.
11879         (temacs$(EXEEXT)): Disable memory randomization for the temacs
11880         binary via PaX flags if the paxctl utility is available.
11881         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11882         Restore PaX flags to their default.  (Bug#11398)
11884 2012-06-03  Chong Yidong  <cyd@gnu.org>
11886         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11887         buffer (Bug#11226).
11889 2012-06-03  Chong Yidong  <cyd@gnu.org>
11891         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11892         (note_mode_line_or_margin_highlight): If there is no help echo,
11893         use mode-line-default-help-echo.  Handle the case where the mouse
11894         position is past the end of the mode line string.
11896         * buffer.c (buffer_local_value_1): New function, split from
11897         Fbuffer_local_value; can return Qunbound.
11898         (Fbuffer_local_value): Use it.
11899         (Vmode_line_format): Docstring tweaks.
11901 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
11903         * sysdep.c (system_process_attributes): Improve comment.
11905 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
11907         * keyboard.c: Export real-this-command to Elisp.
11908         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11909         and DEFVAR it.  Update all users.
11911 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
11913         * minibuf.c (Fassoc_string): Remove duplicate declaration.
11915         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11916         Convert pctcpu and pctmem to Lisp float properly.
11917         Let the compiler fold better, as 100.0/0x8000 is exact.
11919 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
11921         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11922         cons_block.
11924 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
11926         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11928 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
11930         For a 'struct window', replace some Lisp_Object fields to
11931         bitfields where appropriate, remove unused fields.
11932         * window.h (struct window): Remove unused 'last_mark_x' and
11933         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
11934         change its type from Lisp_Object to bitfield.
11935         Change type of 'force_start', 'optional_new_start',
11936         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
11937         fields from Lisp_Object to bitfield.  Adjust users accordingly.
11939 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
11941         Pacify gcc -Wdouble-precision when using Xaw.
11942         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11943         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11944         Use 'float' consistently, rather than 'float' in most places
11945         and 'double' in a couple of places.
11947 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
11949         * xdisp.c (handle_stop): Detect whether we have overlay strings
11950         loaded by testing it->current.overlay_string_index to be
11951         non-negative, instead of checking whether n_overlay_strings is
11952         positive.  (Bug#11587)
11954 2012-05-31  Chong Yidong  <cyd@gnu.org>
11956         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11958         * doc.c (Fsubstitute_command_keys): Doc fix.
11960 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
11962         * search.c (search_buffer): Remove calls to
11963         r_alloc_inhibit_buffer_relocation, as it is now called by
11964         maybe_unify_char, which was the cause of relocation of buffer text
11965         in bug#11519.
11967 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
11969         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11970         for the duration of call to load_charset, to avoid problems with
11971         callers of maybe_unify_char that access buffer text through C
11972         pointers.
11974         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11975         decrement the inhibition flag, instead of just setting or
11976         resetting it.
11978 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
11980         Remove obsolete '#define static' cruft.
11981         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11982         This #undef was "temporary" in 2000; it is no longer needed
11983         now that '#define static' has gone away.
11984         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11985         (gray_bitmap_bits): Remove; no longer needed.
11986         All uses replaced with definiens.
11987         * xterm.c: Include "bitmaps/gray.xbm".
11989 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
11991         Clean up __executable_start, monstartup when --enable-profiling.
11992         The following changes affect the code only when profiling.
11993         * dispnew.c (__executable_start): Rename from safe_bcopy.
11994         Define only on platforms that need it.
11995         * emacs.c: Include <sys/gmon.h> when profiling.
11996         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11997         (__executable_start): Remove decl, since lisp.h does it now.
11998         (safe_bcopy): Remove decl; no longer has that name.
11999         (main): Coalesce #if into single bit of code, for simplicity.
12000         Cast pointers to uintptr_t, since standard libraries want integers
12001         and not pointers.
12002         * lisp.h (__executable_start): New decl.
12004 2012-05-31  Glenn Morris  <rgm@gnu.org>
12006         * image.c (Fimagemagick_types): Doc fix.
12008 2012-05-30  Jim Meyering  <meyering@redhat.com>
12010         * callproc.c (Fcall_process_region): Include directory component
12011         in mkstemp error message (Bug#11586).
12013 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
12015         * alloc.c, lisp.h (make_pure_vector): Now static.
12017 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
12019         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12020         Move to byte-run.el.
12021         (Fautoload): Do the hash-doc more carefully.
12022         * data.c (Fdefalias): Purify definition, except for keymaps.
12023         (Qdefun): Move from eval.c.
12024         * lisp.h (Qdefun): Remove.
12025         * lread.c (read1): Tiny simplification.
12027 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
12029         Do not create empty overlays with the evaporate property (Bug#9642).
12030         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12031         Bug#9642, but explicitly check that the buffer the overlay would
12032         be moved to is live and rearrange lines to make sure that errors
12033         will not put the overlay in an inconsistent state.
12034         (Fdelete_overlay): Cosmetics.
12036 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
12038         * w32term.c (my_bring_window_to_top): New function.
12039         (x_raise_frame): Use handle returned by DeferWindowPos, which
12040         could be different from the original one.
12041         Call my_bring_window_to_top instead of my_set_foreground_window.
12042         (Bug#11513)
12044         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12045         by calling BringWindowToTop.
12047         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12048         (WM_EMACS_END): Increase by one.
12050 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
12052         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12053         This avoids undefined behavior that might cause the eassert
12054         to not catch an out-of-range value.
12056 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
12058         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12059         Update dependencies.
12061 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
12063         * bidi.c (bidi_mirror_char): Fix last change.
12065 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
12067         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12068         when referring to sectname field in printf format.
12070 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
12072         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12073         Only r_alloc_inhibit_buffer_relocation needed to be added;
12074         the others were already declared.
12076         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12077         before checking whether it's out of range.  Put the check inside
12078         eassert.  See
12079         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12081 2012-05-27  Ken Brown  <kbrown@cornell.edu>
12083         * callproc.c (Fcall_process): Restore a line that was accidentally
12084         commented out in the 2011-02-13 change (bug#11547).
12086 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
12088         * lisp.h [REL_ALLOC]: Add prototypes for external functions
12089         defined on ralloc.c.
12091         * buffer.c [REL_ALLOC]: Remove prototypes of
12092         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12093         they are now on lisp.h.
12095         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12097         * search.c (search_buffer): Use it to inhibit relocation of buffer
12098         text while re_search_2 is doing its job, because re_search_2 is
12099         passed C pointers to buffer text.  (Bug#11519)
12101         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12102         Update value to 24.
12104         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12105         state after an additional call to move_it_in_display_line_to, keep
12106         the values of it->max_ascent and it->max_descent found for the
12107         entire line.
12108         (pos_visible_p): Revert the comparison against bottom_y to what it
12109         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12110         (Bug#11464)
12112 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
12114         Fix coding-related core dumps with gcc -ftrapv.
12115         The code was computing A - B, where A and B are pointers, and B is
12116         random garbage.  This can lead to core dumps on platforms that
12117         have special pointer registers, and it also leads to core dumps on
12118         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
12119         A - B only when B is initialized properly.
12120         * coding.c (coding_set_source, coding_set_destination): Return void.
12121         (coding_change_source, coding_change_destinations): New functions,
12122         with the old behaviors of coding_set_source and coding_set_destination.
12123         All callers that need an offset changed to use these new functions.
12125 2012-05-26  Glenn Morris  <rgm@gnu.org>
12127         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
12129 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
12131         Extend mouse support on W32 text-mode console.
12132         * xdisp.c (draw_row_with_mouse_face):
12133         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
12135         * w32console.c: Include window.h.
12136         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12137         New functions.
12138         (initialize_w32_display): Initialize mouse-highlight data.
12140         * w32inevt.c: Include termchar.h and window.h.
12141         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
12142         moves, call note_mouse_highlight.  If help_echo changed, call
12143         gen_help_event to produce help-echo message in the echo area.
12144         Call clear_mouse_face if mouse_face_hidden is set in the mouse
12145         highlight info.
12147 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
12149         * lread.c (read1): Simplify slightly to avoid an overflow warning
12150         with GCC 4.7.0 on x86-64.
12152 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
12154         * bidi.c (bidi_mirror_char): Revert last change: an int is
12155         definitely wide enough here.
12157 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
12159         Fix integer width and related bugs (Bug#9874).
12160         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
12161         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12162         (string_bytes, check_sblock, allocate_string_data):
12163         (compact_small_strings, Fmake_bool_vector, make_string)
12164         (make_unibyte_string, make_multibyte_string)
12165         (make_string_from_bytes, make_specified_string)
12166         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12167         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12168         (mark_vectorlike):
12169         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12170         (allocate_pseudovector):
12171         Use int, not EMACS_INT, where int is wide enough.
12172         (inhibit_garbage_collection, Fgarbage_collect):
12173         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12174         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12175         int might not be wide enough.
12176         (bidi_cache_search, bidi_cache_find, bidi_init_it)
12177         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12178         (bidi_at_paragraph_end, bidi_find_paragraph_start)
12179         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12180         (bidi_level_of_next_char, bidi_move_to_visually_next):
12181         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12182         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12183         (Fkill_buffer, Fset_buffer_major_mode)
12184         (advance_to_char_boundary, Fbuffer_swap_text)
12185         (Fset_buffer_multibyte, overlays_at, overlays_in)
12186         (overlay_touches_p, struct sortvec, record_overlay_string)
12187         (overlay_strings, recenter_overlay_lists)
12188         (adjust_overlays_for_insert, adjust_overlays_for_delete)
12189         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12190         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12191         (Foverlay_recenter, last_overlay_modification_hooks_used)
12192         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12193         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12194         (validate_region): Omit unnecessary test for b <= e,
12195         since that's guaranteed by the previous test.
12196         (adjust_overlays_for_delete): Avoid pos + length overflow.
12197         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12198         (report_overlay_modification):
12199         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12200         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12201         Omit pointer cast, which isn't needed anyway, and doesn't work
12202         after the EMACS_INT -> ptrdiff_t change.
12203         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
12204         * buffer.h: Adjust decls to match defn changes elsewhere.
12205         (struct buffer_text, struct buffer):
12206         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12207         Use EMACS_INT, not int, where int might not be wide enough.
12208         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12209         not int, to avoid needless 32-bit limit on 64-bit hosts.
12210         (exec_byte_code): Use tighter memory-full test, one that checks
12211         for alloca overflow.  Don't compute the address of the object just
12212         before an array, as that's not portable.  Use EMACS_INT, not
12213         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
12214         * callint.c (Fcall_interactively):
12215         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12216         * callproc.c (call_process_kill, Fcall_process):
12217         Don't assume pid_t fits into an Emacs fixnum.
12218         (call_process_cleanup, Fcall_process, child_setup):
12219         Don't assume pid_t fits into int.
12220         (call_process_cleanup, Fcall_process, delete_temp_file)
12221         (Fcall_process_region):
12222         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12223         (Fcall_process): Simplify handling of volatile integers.
12224         Use int, not EMACS_INT, where int will do.
12225         * casefiddle.c (casify_object, casify_region, operate_on_word)
12226         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12227         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12228         (casify_object): Avoid integer overflow when overallocating buffer.
12229         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
12230         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
12231         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12232         * category.h (CATEGORYP): Don't assume arg is nonnegative.
12233         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12234         integers are now checked earlier.  All uses replaced with XINT.
12235         (ccl_driver):
12236         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12237         For CCL_MapSingle, check that content and value are in int range.
12238         (ccl_driver, Fregister_code_conversion_map):
12239         Check that Vcode_version_map_vector is a vector.
12240         (resolve_symbol_ccl_program): Check that vector header is in range.
12241         Always copy the vector, so that we can check its contents reliably
12242         now rather than having to recheck each instruction as it's being
12243         executed.  Check that vector words fit in 'int'.
12244         (ccl_get_compiled_code, Fregister_ccl_program)
12245         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12246         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12247         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12248         contents are in range.
12249         (Fccl_execute_on_string): Check that status is in range.
12250         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12251         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12252         Accept and return EMACS_INT, not int, because callers can pass values
12253         out of 'int' range.
12254         (c_string_width, strwidth, lisp_string_width, chars_in_text)
12255         (multibyte_chars_in_text, parse_str_as_multibyte)
12256         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12257         (str_as_unibyte, str_to_unibyte, string_count_byte8)
12258         (string_escape_byte8, Fget_byte):
12259         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12260         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
12261         avoid mishandling large integers.
12262         * character.h: Adjust decls to match defn changes elsewhere.
12263         * charset.c (load_charset_map_from_file, find_charsets_in_text)
12264         (Ffind_charset_region):
12265         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12266         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12267         (load_charset_map_from_vector, Fdefine_charset_internal):
12268         Don't assume fixnum fits in int.
12269         (load_charset_map_from_vector, Fmap_charset_chars):
12270         Remove now-unnecessary CHECK_NATNUMs.
12271         (Fdefine_charset_internal): Check ranges here, more carefully.
12272         Don't rely on undefined behavior with signed left shift overflow.
12273         Don't assume unsigned int fits into fixnum, or that fixnum fits
12274         into unsigned int.  Don't require max_code to be a valid fixnum;
12275         that's not true for gb10830 4-byte on a 32-bit host.  Allow
12276         invalid_code to be a cons, for the same reason.  Require code_offset
12277         to be a character.  Avoid int overflow if max_char is close
12278         to INT_MAX.
12279         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12280         this is intended anyway and avoids some undefined behavior.
12281         (load_charset_map): Pass unsigned, not int, as 2nd arg of
12282         INDEX_TO_CODE_POINT, as that's what it expects.
12283         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
12284         * charset.h (DECODE_CHAR): Return int, not unsigned;
12285         this is what was intended anyway, and it avoids undefined behavior.
12286         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12287         integer-overflow issues.
12288         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12289         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12290         where the argument is EMACS_INT, and this behavior is not intended.
12291         * chartab.c (Fmake_char_table, Fset_char_table_range)
12292         (uniprop_get_decoder, uniprop_get_encoder):
12293         Don't assume fixnum fits in int.
12294         * cmds.c (move_point): New function, that does the gist of
12295         Fforward_char and Fbackward_char, but does so while checking
12296         for integer overflow more accurately.
12297         (Fforward_char, Fbackward_char): Use it.
12298         (Fforward_line, Fend_of_line, internal_self_insert)
12299         (internal_self_insert):
12300         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12301         Fix a FIXME, by checking for integer overflow when calculating
12302         target_clm and actual_clm.
12303         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
12304         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
12305         (ASSURE_DESTINATION, coding_alloc_by_realloc)
12306         (coding_alloc_by_making_gap, alloc_destination)
12307         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12308         (encode_coding_utf_16, detect_coding_emacs_mule)
12309         (decode_coding_emacs_mule, encode_coding_emacs_mule)
12310         (detect_coding_iso_2022, decode_coding_iso_2022)
12311         (encode_invocation_designation, encode_designation_at_bol)
12312         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12313         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12314         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12315         (encode_coding_ccl, encode_coding_raw_text)
12316         (detect_coding_charset, decode_coding_charset)
12317         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12318         (produce_composition, produce_charset, produce_annotation)
12319         (decode_coding, handle_composition_annotation)
12320         (handle_charset_annotation, consume_chars, decode_coding_gap)
12321         (decode_coding_object, encode_coding_object, detect_coding_system)
12322         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12323         (code_convert_region, code_convert_string)
12324         (Fdefine_coding_system_internal)
12325         (coding_set_source, coding_set_destination):
12326         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12327         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12328         (Fdefine_coding_system_internal):
12329         Don't assume fixnums fit in int.
12330         (decode_coding_gap, decode_coding_object, encode_coding_object)
12331         (Fread_coding_system, Fdetect_coding_region)
12332         (Funencodable_char_position, Fcheck_coding_systems_region)
12333         (get_translation, handle_composition_annotation, consume_chars):
12334         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12335         (consume_chars): Rewrite to not calculate an address outside buffer.
12336         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
12337         Don't access memory outside of the args array.
12338         (Fdefine_coding_system_internal): Check for charset-id overflow.
12339         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12340         result of ENCODE_CHAR.
12341         * coding.h: Adjust decls to match defn changes elsewhere.
12342         (struct coding_system):
12343         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12344         * composite.c (get_composition_id, find_composition)
12345         (run_composition_function, update_compositions)
12346         (compose_text, composition_gstring_put_cache)
12347         (composition_gstring_p, composition_gstring_width)
12348         (fill_gstring_header, fill_gstring_body, autocmp_chars)
12349         (composition_compute_stop_pos, composition_reseat_it)
12350         (composition_update_it, struct position_record)
12351         (find_automatic_composition, composition_adjust_point)
12352         (Fcomposition_get_gstring, Ffind_composition_internal):
12353         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12354         (update_compositions):
12355         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12356         * composite.h: Adjust decls to match defn changes elsewhere.
12357         (struct composition):
12358         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12359         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12360         Do not attempt to compute the address of the object just before a
12361         buffer; this is not portable.
12362         (Faref, Faset):
12363         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12364         (Faset): Use int, not EMACS_INT, where int is wide enough.
12365         (Fstring_to_number): Don't assume fixnums fit in int.
12366         (Frem): Don't assume arg is nonnegative.
12367         * dbusbind.c (xd_append_arg): Check for integers out of range.
12368         (Fdbus_call_method): Don't overflow the timeout int.
12369         (extract_signed, extract_unsigned): New functions.
12370         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12371         (xd_get_connection_references): Return ptrdiff_t, not int.
12372         All uses changed.
12373         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12374         (xd_read_message_1):
12375         Use int, not unsigned, where the dbus API uses int.
12376         (Fdbus_message_internal): Don't overflow mtype.
12377         (syms_of_dbusbind): Allocate right-sized buffer for integers.
12378         * dired.c (directory_files_internal, file_name_completion, scmp)
12379         (file_name_completion_stat):
12380         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12381         (file_name_completion): Don't overflow matchcount.
12382         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12383         * dispextern.h: Adjust decls to match defn changes elsewhere.
12384         (struct text_pos, struct glyph, struct bidi_saved_info)
12385         (struct bidi_string_data, struct bidi_it, struct composition_it)
12386         (struct it):
12387         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12388         (struct display_pos, struct composition_it, struct it):
12389         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12390         * dispnew.c (increment_matrix_positions)
12391         (increment_row_positions, mode_line_string)
12392         (marginal_area_string):
12393         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12394         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
12395         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12396         (duration_to_sec_usec): New function, to check for overflow better.
12397         (Fsleep_for, sit_for): Use it.
12398         * doc.c (get_doc_string, store_function_docstring):
12399         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12400         (get_doc_string, Fsnarf_documentation):
12401         Use int, not EMACS_INT, where int is wide enough.
12402         (get_doc_string):
12403         Use SAFE_ALLOCA, not alloca.
12404         Check for overflow when converting EMACS_INT to off_t.
12405         * doprnt.c (doprnt):
12406         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12407         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12408         Don't assume uid_t fits into fixnum.
12409         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12410         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12411         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12412         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12413         (general_insert_function)
12414         (Finsert_char, make_buffer_string, make_buffer_string_both)
12415         (update_buffer_properties, Fbuffer_substring)
12416         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12417         (Fsubst_char_in_region, check_translation)
12418         (Ftranslate_region_internal, save_restriction_restore, Fformat)
12419         (transpose_markers, Ftranspose_regions):
12420         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12421         (clip_to_bounds): Move to lisp.h as an inline function).
12422         (Fconstrain_to_field): Don't assume integers are nonnegative.
12423         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12424         (Fsubst_char_in_region, Fsave_restriction):
12425         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12426         (Femacs_pid): Don't assume pid_t fits into fixnum.
12427         (lo_time): Use int, not EMACS_INT, when int suffices.
12428         (lisp_time_argument): Check for usec out of range.
12429         (Fencode_time): Don't assume fixnum fits in int.
12430         (Fuser_login_name, Fuser_full_name): Signal an error
12431         if a uid argument is out of range, rather than relying on
12432         undefined behavior.
12433         (Fformat_time_string): Remove now-unnecessary check.
12434         lisp_time_argument checks for out-of-range usec now.
12435         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
12436         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12437         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12438         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12439         (init_cmdargs, Fdump_emacs):
12440         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12441         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12442         the bottom (typically) 32 bits of the fixnum.
12443         * eval.c (specpdl_size, call_debugger):
12444         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12445         (when_entered_debugger, Fbacktrace_debug):
12446         Don't assume fixnum can fit in int.
12447         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12448         the object just before a buffer; this is not portable.
12449         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12450         (grow_specpdl, unbind_to):
12451         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12452         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12453         (grow_specpdl): Simplify allocation by using xpalloc.
12454         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
12455         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12456         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12457         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12458         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12459         (a_write, e_write):
12460         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12461         (Fcopy_file, non_regular_nbytes, read_non_regular)
12462         (Finsert_file_contents):
12463         Use int, not EMACS_INT, where int is wide enough.
12464         (READ_BUF_SIZE): Verify that it fits in int.
12465         (Finsert_file_contents): Check that counts are in proper range,
12466         rather than assuming fixnums fit into ptrdiff_t etc.
12467         Don't assume fixnums fit into int.
12468         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
12469         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12470         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
12471         (string_char_to_byte, string_byte_to_char)
12472         (string_make_multibyte, string_to_multibyte)
12473         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12474         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12475         (substring_both, Fdelete, internal_equal, Ffillarray)
12476         (Fclear_string, mapcar1)
12477         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12478         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12479         (larger_vector, make_hash_table, maybe_resize_hash_table)
12480         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12481         (Fmaphash, secure_hash):
12482         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12483         (concat): Check for string index and length overflow.
12484         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12485         (Frequire):
12486         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12487         (larger_vector): New API (vec, incr_min, size_max) replaces old
12488         one (vec, new_size, init).  This catches size overflow.
12489         INIT was removed because it was always Qnil.
12490         All callers changed.
12491         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12492         the upper bound on a hash table index size.
12493         (make_hash_table, maybe_resize_hash_table): Use it.
12494         (secure_hash): Computer start_byte and end_byte only after
12495         they're known to be in ptrdiff_t range.
12496         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12497         (Ffont_get_glyphs, Ffont_at):
12498         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12499         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12500         (Flist_fonts, Fopen_font):
12501         Don't assume fixnum can fit in int.
12502         (check_gstring): Don't assume index can fit in int.
12503         (font_match_p): Check that fixnum is a character, not a nonnegative
12504         fixnum, since the later code needs to stuff it into an int.
12505         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12506         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12507         conversion overflow issues.
12508         (Fopen_font): Check for integer out of  range.
12509         (Ffont_get_glyphs): Don't assume index can fit in int.
12510         * font.h: Adjust decls to match defn changes elsewhere.
12511         * fontset.c (reorder_font_vector): Redo score calculation to avoid
12512         integer overflow.
12513         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12514         printmax_t, where ptrdiff_t is wide enough.
12515         (Finternal_char_font):
12516         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12517         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12518         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12519         (Fset_frame_position, x_set_frame_parameters)
12520         (x_set_line_spacing, x_set_border_width)
12521         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12522         Check that fixnums are in proper range for system types.
12523         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12524         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12525         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12526         Use SAFE_ALLOCA_LISP, not alloca.
12527         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12528         intptr_t is wide enough.
12529         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12530         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12531         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12532         Check for fixnum out of range.
12533         * ftfont.c (ftfont_list): Don't assume index fits in int.
12534         Check that fixnums are in proper range for system types.
12535         (ftfont_shape_by_flt):
12536         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12537         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12538         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12539         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12540         Check that fixnums are in proper range for system types.
12541         * gnutls.h: Adjust decls to match defn changes elsewhere.
12542         * gtkutil.c (xg_dialog_run):
12543         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12544         (update_frame_tool_bar):
12545         Check that fixnums are in proper range for system types.
12546         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
12547         (lookup_image): Check that fixnums are in range for system types.
12548         * indent.c (last_known_column, last_known_column_point):
12549         (current_column_bol_cache):
12550         (skip_invisible, current_column, check_display_width):
12551         (check_display_width, scan_for_column, current_column_1)
12552         (Findent_to, Fcurrent_indentation, position_indentation)
12553         (indented_beyond_p, Fmove_to_column, compute_motion):
12554         (Fcompute_motion, Fvertical_motion):
12555         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12556         (last_known_column_modified): Use EMACS_INT, not int.
12557         (check_display_width):
12558         (Fcompute_motion):
12559         Check that fixnums and floats are in proper range for system types.
12560         (compute_motion): Don't assume index or fixnum fits in int.
12561         (compute_motion, Fcompute_motion):
12562         Use int, not EMACS_INT, when it is wide enough.
12563         (vmotion): Omit local var start_hpos that is always 0; that way
12564         we don't need to worry about overflow in expressions involving it.
12565         * indent.h: Adjust decls to match defn changes elsewhere.
12566         (struct position):
12567         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12568         Use int, not EMACS_INT, where int is wide enough.
12569         Remove unused members ovstring_chars_done and tab_offset;
12570         all uses removed.
12571         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12572         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12573         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12574         (make_gap, copy_text, insert, insert_and_inherit)
12575         (insert_before_markers, insert_before_markers_and_inherit)
12576         (insert_1, count_combining_before, count_combining_after)
12577         (insert_1_both, insert_from_string)
12578         (insert_from_string_before_markers, insert_from_string_1)
12579         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12580         (adjust_after_replace, adjust_after_insert, replace_range)
12581         (replace_range_2, del_range, del_range_1, del_range_byte)
12582         (del_range_both, del_range_2, modify_region)
12583         (prepare_to_modify_buffer, signal_before_change)
12584         (signal_after_change, Fcombine_after_change_execute):
12585         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12586         * intervals.c (traverse_intervals, rotate_right, rotate_left)
12587         (balance_an_interval, split_interval_right, split_interval_left)
12588         (find_interval, next_interval, update_interval)
12589         (adjust_intervals_for_insertion, delete_node, delete_interval)
12590         (interval_deletion_adjustment, adjust_intervals_for_deletion)
12591         (static_offset_intervals, offset_intervals)
12592         (merge_interval_right, merge_interval_left, make_new_interval)
12593         (graft_intervals_into_buffer, temp_set_point_both)
12594         (temp_set_point, set_point, adjust_for_invis_intang)
12595         (set_point_both, move_if_not_intangible, get_property_and_range)
12596         (get_local_map, copy_intervals, copy_intervals_to_string)
12597         (compare_string_intervals, set_intervals_multibyte_1):
12598         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12599         * intervals.h: Adjust decls to match defn changes elsewhere.
12600         (struct interval):
12601         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12602         * keyboard.c (this_command_key_count, this_single_command_key_start)
12603         (before_command_key_count, before_command_echo_length, echo_now)
12604         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12605         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12606         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12607         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12608         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12609         (last_non_minibuf_size, last_point_position, echo_truncate)
12610         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12611         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12612         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12613         (stuff_buffered_input):
12614         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12615         (last_auto_save, command_loop_1, read_char):
12616         Use EMACS_INT, not int, to avoid integer overflow.
12617         (record_char): Avoid overflow in total_keys computation.
12618         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12619         * keyboard.h: Adjust decls to match defn changes elsewhere.
12620         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12621         (Fkey_description, Fdescribe_vector, Flookup_key):
12622         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12623         (click_position): New function, to check that positions are in range.
12624         (Fcurrent_active_maps):
12625         (describe_command):
12626         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12627         (Faccessible_keymaps, Fkey_description):
12628         (preferred_sequence_p):
12629         Don't assume fixnum can fit into int.
12630         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12631         Check for integer overflow in size calculations.
12632         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12633         avoid mishandling large integers.
12634         * lisp.h: Adjust decls to match defn changes elsewhere.
12635         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12636         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12637         (struct Lisp_Marker):
12638         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12639         (clip_to_bounds): Now an inline function, moved here from editfns.c.
12640         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12641         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12642         All callers changed.
12643         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12644         Assume the arg has valid form, since it always does.
12645         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12646         unsigned integer system type.
12647         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12648         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12649         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12650         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12651         (duration_to_sec_usec): New decl.
12652         * lread.c (read_from_string_index, read_from_string_index_byte)
12653         (read_from_string_limit, readchar, unreadchar, openp)
12654         (read_internal_start, read1, oblookup):
12655         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12656         (Fload, readevalloop, Feval_buffer, Feval_region):
12657         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12658         (openp): Check for out-of-range argument to 'access'.
12659         (read1): Use int, not EMACS_INT, where int is wide enough.
12660         Don't assume fixnum fits into int.
12661         Fix off-by-one error that can read outside a buffer.
12662         (read_filtered_event): Use duration_to_sec_usec
12663         to do proper overflow checking on durations.
12664         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12665         in size calculation.
12666         (Fexecute_kbd_macro):
12667         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12668         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12669         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12670         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12671         (set_marker_both, set_marker_restricted_both, marker_position)
12672         (marker_byte_position, Fbuffer_has_markers_at):
12673         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12674         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
12675         * menu.c (ensure_menu_items): Rename from grow_menu_items.
12676         It now merely ensures that the menu is large enough, without
12677         necessarily growing it, as this avoids some integer overflow issues.
12678         All callers changed.
12679         (keymap_panes, parse_single_submenu, Fx_popup_menu):
12680         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12681         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12682         Use SAFE_ALLOCA_LISP, not alloca.
12683         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12684         to EMACS_INT.  Check that fixnums are in proper range for system types.
12685         * minibuf.c (minibuf_prompt_width, string_to_object)
12686         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12687         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12688         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12689         (get_minibuffer, read_minibuf_unwind):
12690         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12691         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12692         this simplifies overflow checking.  All callers changed.
12693         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12694         (Ftest_completion):
12695         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12696         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12697         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12698         Check that fixnums are in proper range for system types.
12699         (Fx_create_frame, Fx_show_tip):
12700         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12701         * nsfont.m (ns_findfonts, nsfont_list_family):
12702         Don't assume fixnum fits in long.
12703         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12704         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12705         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12706         wide enough.
12707         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
12708         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12709         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12710         (PRINTDECLARE, PRINTPREPARE):
12711         (strout, print_string):
12712         (print, print_preprocess, print_check_string_charset_prop)
12713         (print_object):
12714         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12715         (PRINTDECLARE):
12716         (temp_output_buffer_setup, Fprin1_to_string, print_object):
12717         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12718         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
12719         (printchar, strout): Use xpalloc to catch size calculation overflow.
12720         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
12721         (print_error_message): Use SAFE_ALLOCA, not alloca.
12722         (print_object): Use int, not EMACS_INT, where int is wide enough.
12723         (print_depth, new_backquote_output, print_number_index):
12724         Use ptrdiff_t, not int, where int might not be wide enough.
12725         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12726         (Fset_process_window_size, Fformat_network_address)
12727         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
12728         (sigchld_handler):
12729         Check that fixnums are in proper range for system types.
12730         (Fsignal_process): Simplify by avoiding a goto.
12731         Check for process-ids out of pid_t range rather than relying on
12732         undefined behavior.
12733         (process_tick, update_tick): Use EMACS_INT, not int.
12734         (Fformat_network_address, read_process_output, send_process)
12735         (Fprocess_send_region, status_notify):
12736         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12737         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12738         (wait_reading_process_output, read_process_output, exec_sentinel):
12739         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12740         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12741         (Faccept_process_output): Use duration_to_sec_usec to do proper
12742         overflow checking on durations.
12743         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12744         Don't assume pid_t fits in int.
12745         * process.h (struct Lisp_Process): Members tick and update_tick
12746         are now of type EMACS_INT, not int.
12747         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12748         configured --with-wide-int.
12749         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12750         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12751         * search.c (looking_at_1, string_match_1):
12752         (fast_string_match, fast_c_string_match_ignore_case)
12753         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12754         (scan_newline, find_before_next_newline, search_command)
12755         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12756         (set_search_regs, wordify):
12757         (Freplace_match):
12758         (Fmatch_data):
12759         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12760         (string_match_1, search_buffer, set_search_regs):
12761         (Fmatch_data):
12762         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12763         (wordify): Check for overflow in size calculation.
12764         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12765         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12766         Check that fixnums are in proper range for system types.
12767         * sound.c (struct sound_device)
12768         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12769         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12770         (Fplay_sound_internal):
12771         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12772         * syntax.c (struct lisp_parse_state, find_start_modiff)
12773         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12774         (Fparse_partial_sexp):
12775         Don't assume fixnums can fit in int.
12776         (struct lisp_parse_state, find_start_pos, find_start_value)
12777         (find_start_value_byte, find_start_begv)
12778         (update_syntax_table, char_quoted, dec_bytepos)
12779         (find_defun_start, prev_char_comend_first, back_comment):
12780         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12781         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12782         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12783         (Finternal_describe_syntax_value): Check that match_lisp is a
12784         character, not an integer, since the code stuffs it into int.
12785         (scan_words, scan_sexps_forward):
12786         Check that fixnums are in proper range for system types.
12787         (Fforward_word):
12788         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12789         (scan_sexps_forward):
12790         Use CHARACTERP, not INTEGERP, since the value must fit into int.
12791         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12792         * syntax.h: Adjust decls to match defn changes elsewhere.
12793         (struct gl_state_s):
12794         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12795         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12796         MOST_POSITIVE_FIXNUM.
12797         * sysdep.c (wait_for_termination_1, wait_for_termination)
12798         (interruptible_wait_for_termination, mkdir):
12799         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12800         (emacs_read, emacs_write):
12801         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12802         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12803         and double all fit in int.
12804         * term.c (set_tty_color_mode):
12805         Check that fixnums are in proper range for system types.
12806         * termhooks.h (struct input_event):
12807         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12808         * textprop.c (validate_interval_range, interval_of)
12809         (Fadd_text_properties, set_text_properties_1)
12810         (Fremove_text_properties, Fremove_list_of_text_properties)
12811         (Ftext_property_any, Ftext_property_not_all)
12812         (copy_text_properties, text_property_list, extend_property_ranges)
12813         (verify_interval_modification):
12814         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12815         (Fnext_single_char_property_change)
12816         (Fprevious_single_char_property_change):
12817         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12818         (copy_text_properties):
12819         Check for integer overflow in index calculation.
12820         * undo.c (last_boundary_position, record_point, record_insert)
12821         (record_delete, record_marker_adjustment, record_change)
12822         (record_property_change):
12823         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12824         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12825         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12826         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12827         (Fx_hide_tip, Fx_file_dialog):
12828         * w32menu.c (set_frame_menubar):
12829         Use ptrdiff_t, not int, for consistency with rest of code.
12830         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12831         (select_window, Fdelete_other_windows_internal)
12832         (window_scroll_pixel_based, window_scroll_line_based)
12833         (Frecenter, Fset_window_configuration):
12834         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12835         (Fset_window_hscroll, run_window_configuration_change_hook)
12836         (set_window_buffer, temp_output_buffer_show, scroll_command)
12837         (Fscroll_other_window, Frecenter):
12838         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12839         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12840         Don't assume fixnum fits in int.
12841         (Fset_window_scroll_bars):
12842         Check that fixnums are in proper range for system types.
12843         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12844         (string_pos, c_string_pos, number_of_chars, init_iterator)
12845         (in_ellipses_for_invisible_text_p, init_from_display_pos)
12846         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12847         (compute_display_string_end, handle_face_prop)
12848         (face_before_or_after_it_pos, handle_invisible_prop)
12849         (handle_display_prop, handle_display_spec, handle_single_display_spec)
12850         (display_prop_intangible_p, string_buffer_position_lim)
12851         (string_buffer_position, handle_composition_prop, load_overlay_strings)
12852         (get_overlay_strings_1, get_overlay_strings)
12853         (iterate_out_of_display_property, forward_to_next_line_start)
12854         (back_to_previous_visible_line_start, reseat, reseat_to_string)
12855         (get_next_display_element, set_iterator_to_next)
12856         (get_visually_first_element, compute_stop_pos_backwards)
12857         (handle_stop_backwards, next_element_from_buffer)
12858         (move_it_in_display_line_to, move_it_in_display_line)
12859         (move_it_to, move_it_vertically_backward, move_it_by_lines)
12860         (add_to_log, message_dolog, message_log_check_duplicate)
12861         (message2, message2_nolog, message3, message3_nolog
12862         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12863         (current_message_1, truncate_echo_area, truncate_message_1)
12864         (set_message, set_message_1, store_mode_line_noprop)
12865         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12866         (text_outside_line_unchanged_p, check_point_in_composition)
12867         (reconsider_clip_changes)
12868         (redisplay_internal, set_cursor_from_row, try_scrolling)
12869         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12870         (redisplay_window, find_last_unchanged_at_beg_row)
12871         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12872         (trailing_whitespace_p, find_row_edges, display_line)
12873         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12874         (display_mode_element, store_mode_line_string)
12875         (pint2str, pint2hrstr, decode_mode_spec)
12876         (display_count_lines, display_string, draw_glyphs)
12877         (x_produce_glyphs, x_insert_glyphs)
12878         (rows_from_pos_range, mouse_face_from_buffer_pos)
12879         (fast_find_string_pos, mouse_face_from_string_pos)
12880         (note_mode_line_or_margin_highlight, note_mouse_highlight):
12881         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12882         (safe_call, init_from_display_pos, handle_fontified_prop)
12883         (handle_single_display_spec, load_overlay_strings)
12884         (with_echo_area_buffer, setup_echo_area_for_printing)
12885         (display_echo_area, echo_area_display)
12886         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12887         (update_tool_bar, hscroll_window_tree, redisplay_internal)
12888         (redisplay_window, dump_glyph_row, display_mode_line)
12889         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
12890         (handle_display_spec, display_prop_string_p):
12891         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12892         (handle_single_display_spec, build_desired_tool_bar_string)
12893         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12894         (get_specified_cursor_type):
12895         Check that fixnums are in proper range for system types.
12896         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12897         (Flookup_image_map):
12898         Don't assume fixnums fit in int.
12899         (compare_overlay_entries):
12900         Avoid mishandling comparisons due to subtraction overflow.
12901         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12902         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12903         (handle_tool_bar_click):
12904         Use int, not unsigned, since we prefer signed and the signedness
12905         doesn't matter here.
12906         (get_next_display_element, next_element_from_display_vector):
12907         Use int, not EMACS_INT, when int is wide enough.
12908         (start_hourglass): Use duration_to_sec_usec to do proper
12909         overflow checking on durations.
12910         * xfaces.c (Fbitmap_spec_p):
12911         Check that fixnums are in proper range for system types.
12912         (compare_fonts_by_sort_order):
12913         Avoid mishandling comparisons due to subtraction overflow.
12914         (Fx_family_fonts, realize_basic_faces):
12915         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12916         (Fx_family_fonts):
12917         Don't assume fixnum fits in int.
12918         Use SAFE_ALLOCA_LISP, not alloca.
12919         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12920         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12921         (face_at_buffer_position, face_for_overlay_string)
12922         (face_at_string_position):
12923         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12924         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12925         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12926         (Fx_show_tip):
12927         Check that fixnums are in proper range for system types.
12928         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12929         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12930         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12931         (Fx_change_window_property): Don't assume fixnums fit in int.
12932         * xfont.c (xfont_chars_supported):
12933         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12934         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12935         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12936         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12937         * xml.c (parse_region):
12938         * xrdb.c (magic_file_p):
12939         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12940         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12941         (x_get_local_selection, x_reply_selection_request)
12942         (x_handle_selection_request, wait_for_property_change):
12943         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12944         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12945         short is wide enough.
12946         (x_send_client_event): Don't assume fixnum fits in int.
12947         * xterm.c (x_x_to_emacs_modifiers):
12948         Don't assume EMACS_INT overflows nicely into int.
12949         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12950         may come from Lisp.
12951         (handle_one_xevent): NATNUMP can eval its arg twice.
12952         (x_connection_closed):
12953         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12954         * xterm.h: Adjust decls to match defn changes elsewhere.
12955         (struct scroll_bar): Use struct vectorlike_header
12956         rather than rolling our own approximation.
12957         (SCROLL_BAR_VEC_SIZE): Remove; not used.
12959 2012-05-25  Glenn Morris  <rgm@gnu.org>
12961         * lisp.mk (lisp): Update for more files being compiled now.
12963 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
12965         * lread.c: Remove `read_pure' which makes no difference.
12966         (read_pure): Remove var.
12967         (unreadpure): Remove function.
12968         (readevalloop): Don't call read_list with -1 flag.
12969         (read1, read_vector): Don't test read_pure any more.
12970         (read_list): Simplify.
12972         * fileio.c, character.h: Minor style tweaks.
12974 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
12976         * window.h (clip_changed): Remove useless declaration.
12978 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
12980         * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12981         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12983 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
12985         Remove src/m/*.
12986         This directory predates autoconf and is no longer needed nowadays.
12987         Move its few remaining bits of functionality to where they're needed.
12988         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12989         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12990         * m/template.h: Remove.
12991         * Makefile.in (M_FILE): Remove.  All uses removed.
12992         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12993         * lisp.h (USE_LSB_TAG):
12994         * mem-limits.h (EXCEEDS_LISP_PTR):
12995         Use VAL_MAX, not VALBITS, in #if.
12996         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12997         (EMACS_UINT): Define unconditionally now.
12998         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12999         (BITS_PER_EMACS_INT): New constants, replacing
13000         what used to be in config.h, but not useful in #if.
13001         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13002         define them any more.
13003         (VAL_MAX): New macro.
13004         (VALMASK): Use it.
13005         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13006         BITS_PER_EMACS_INT, in #if.
13007         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13008         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13009         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13010         * s/ms-w32.h (DATA_START):
13011         Move here from removed file m/intel386.h.
13012         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13013         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13015 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
13017         Assume C89 or later.
13018         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13019         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13020         (xrealloc):
13021         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13022         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13023         * textprop.c, tparam.c (NULL): Remove.
13024         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13025         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13026         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
13027         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13028         * xterm.c (input_signal_count): Assume volatile works.
13030 2012-05-21  Ken Brown  <kbrown@cornell.edu>
13032         * xgselect.c (xg_select): Fix first argument in call to 'select'
13033         (bug#11508).
13035 2012-05-20  Ken Brown  <kbrown@cornell.edu>
13037         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
13038         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
13040 2012-05-19  Ken Brown  <kbrown@cornell.edu>
13042         * xfns.c (x_in_use): Remove `static' qualifier.
13043         * xterm.h (x_in_use): Declare.
13044         * xgselect.c: Include xterm.h.
13045         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13046         and `display_arg' (bug#9754).
13048 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
13050         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13052         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13053         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13055 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
13057         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13059         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
13060         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
13062         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13063         reference to image_cache->refcount.
13064         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13066 2012-05-17  Juri Linkov  <juri@jurta.org>
13068         * search.c (Fword_search_regexp, Fword_search_backward)
13069         (Fword_search_forward, Fword_search_backward_lax)
13070         (Fword_search_forward_lax): Move functions to isearch.el
13071         (bug#10145, bug#11381).
13073 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
13075         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13077 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
13079         * lread.c (init_obarray): Declare Qt and Qnil as special.
13081 2012-05-14  Glenn Morris  <rgm@gnu.org>
13083         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
13084         Put "libexec" before "bin", for the sake of init_callproc_1.
13086 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
13088         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13090         * unexaix.c: Port to more-recent AIX compilers.
13091         (report_error, report_error_1, make_hdr, copy_sym)
13092         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13093         Make arguments const char *, not char *, to avoid violations of C
13094         standard and to fix some AIX warnings reported by Gilles Pion.
13096 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
13098         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13099         already have overlays loaded.
13100         (handle_single_display_spec): Before returning without displaying
13101         fringe bitmap, synchronize the bidi iterator with the main display
13102         iterator, by calling iterate_out_of_display_property.
13103         (iterate_out_of_display_property): Detect buffer iteration by
13104         testing that it->string is a Lisp string.
13105         (get_next_display_element): When the current object is exhausted,
13106         and there's something on it->stack, call set_iterator_to_next to
13107         proceed with what's on the stack, instead of returning zero.
13108         (set_iterator_to_next): If called at the end of a Lisp string,
13109         proceed to consider_string_end without incrementing string
13110         position.  Don't increment display vector index past the end of
13111         the display vector.  (Bug#11417)
13112         (pos_visible_p): Don't report a position visible when move_it_to
13113         stopped at the last line of window, which happens to be scanned
13114         backwards by the bidi iteration.  (Bug#11464)
13116 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
13118         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13119         and right-margin display specs even if the spec is invalid or we
13120         are on a TTY, and thus unable to display on the fringes.
13121         That's because the text with the property will not be displayed anyway,
13122         so we need to signal to the caller that this is a "replacing"
13123         display spec.  This fixes display when the spec is invalid or we
13124         are on a TTY.
13126 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
13128         * unexaix.c (make_hdr): Fix typo in prototype.
13129         This bug broke the build on AIX.  Problem reported by Gilles Pion.
13131 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
13133         * keyboard.c (kbd_buffer_get_event): Read special events also in
13134         batch mode.  (Bug#11415)
13136 2012-05-12  Glenn Morris  <rgm@gnu.org>
13138         * ns.mk: Update for ns_appbindir no longer having trailing "/".
13140 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
13142         * lisp.mk (lisp): Add newcomment.elc.
13144 2012-05-12  Glenn Morris  <rgm@gnu.org>
13146         * Makefile.in (MKDIR_P): New, set by configure.
13147         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13149 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
13151         Remove unused function hourglass_started.
13152         * dispextern.h (hourglass_started):
13153         * w32fns.c (hourglass_started):
13154         * xdisp.c (hourglass_started): Remove.
13156 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
13158         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13159         Update dependencies.
13161 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
13163         * xgselect.c (xg_select): Put maxfds+1 into a var.
13164         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13166         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13168 2012-05-10  Dave Abrahams  <dave@boostpro.com>
13170         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13171         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
13173 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
13175         * dbusbind.c (xd_registered_buses): New internal Lisp object.
13176         Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
13177         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13178         Initialize xd_registered_buses.
13180 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
13182         Untag more efficiently if USE_LSB_TAG.
13183         This is based on a proposal by YAMAMOTO Mitsuharu in
13184         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13185         For an admittedly artificial (nth 8000 longlist) benchmark on
13186         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
13187         Emacs's overall text size by 1%.
13188         * lisp.h (XUNTAG): New macro.
13189         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13190         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13191         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13192         * eval.c (Fautoload):
13193         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13194         * frame.h (XFRAME): Use XUNTAG.
13196         Port recent dbusbind.c changes to 32-bit --with-wide-int.
13197         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13198         Remove unportable assumptions about print widths of types like
13199         dbus_uint32_t.
13200         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13201         intptr_t when converting between pointer and integer, to avoid GCC
13202         warnings about wrong width.
13204 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
13206         * w32proc.c (new_child): Force Windows to reserve only 64KB of
13207         stack for each reader_thread, instead of defaulting to 8MB
13208         determined by the linker.  This avoids failures in creating
13209         subprocesses on Windows 7, see the discussion in this thread:
13210         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13212 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
13214         Fix up display of the *Minibuf-0* buffer in the mini window.
13215         * keyboard.c (read_char): Don't clear the echo area if there's no
13216         message to clear.
13217         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
13218         contents of *Minibuf-0*) if there's no message displayed in its stead.
13220 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
13222         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13223         batch mode.
13225 2012-05-06  Chong Yidong  <cyd@gnu.org>
13227         * lisp.mk (lisp): Update.
13229 2012-05-05  Jim Meyering  <meyering@redhat.com>
13231         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13233 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
13235         * data.c (PUT_ERROR): New macro.
13236         (syms_of_data): Use it.  Add new error type `user-error'.
13237         * undo.c (user_error): New function.
13238         (Fprimitive_undo): Use it.
13239         * print.c (print_error_message): Adjust print style for `user-error'.
13240         * keyboard.c (user_error): New function.
13241         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13243 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
13245         Do not limit current-time-string to years 1000..9999.
13246         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13247         (Fcurrent_time_string): Support any year that is supported by the
13248         underlying localtime representation.  Don't use asctime, as it
13249         has undefined behavior for years outside the range -999..9999.
13251 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
13253         Fix race conditions involving setenv, gmtime, localtime, asctime.
13254         Without this fix, interrupts could mess up code that uses these
13255         nonreentrant functions, since setting TZ invalidates existing
13256         tm_zone or tzname values, and since most of these functions return
13257         pointers to static storage.
13258         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13259         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13260         Grow the critical sections to include not just invoking
13261         localtime/gmtime, but also accessing these functions' results
13262         including their tm_zone values if any, and any related TZ setting.
13263         (format_time_string): Last arg is now struct tm *, not struct tm **,
13264         so that the struct tm is saved in the critical section.
13265         All callers changed.  Simplify allocation of initial buffer, partly
13266         motivated by the fact that memory allocation needs to be outside
13267         the critical section.
13269 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
13271         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13272         with RESET_INTERVAL.
13274         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13275         Remove duplicated buffer name initialization.
13277 2012-05-02  Jim Meyering  <jim@meyering.net>
13279         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13281         * xfns.c (x_window): Use xstrdup (Bug#11375).
13283 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
13285         * xdisp.c (pos_visible_p): If already at a newline from the
13286         display string before the 'while' loop, don't walk back the glyphs
13287         from it3.glyph_row.  Solves assertion violation when the display
13288         string begins with a newline (egg.el).  (Bug#11367)
13290 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
13292         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13293         Move to simple.el.
13295 2012-05-01  Glenn Morris  <rgm@gnu.org>
13297         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13298         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13299         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13300         All were removed before 23.1.
13302         * dispnew.c: Remove HAVE_LIBNCURSES test;
13303         it is always true on relevant platforms.
13305         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13306         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13308         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13310 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
13312         * .gdbinit (xpr): Remove checks for no longer existing misc types.
13313         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13314         Remove.
13316 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
13318         Do not avoid creating empty evaporating overlays (Bug#9642).
13319         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13320         That is, do not delete an evaporating overlay if it becomes
13321         empty after its bounds are adjusted to fit within its buffer.
13322         This fix caused other problems, and I'm reverting it until we get
13323         to the bottom of them.
13325 2012-04-27  Chong Yidong  <cyd@gnu.org>
13327         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13329 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
13331         * xdisp.c (pos_visible_p): If the window start position is beyond
13332         ZV, start the display from buffer beginning.  Prevents assertion
13333         violation in init_iterator when the minibuffer window is scrolled
13334         via the scroll bar.
13336         * window.c (window_scroll_pixel_based): Likewise.
13338 2012-04-27  Chong Yidong  <cyd@gnu.org>
13340         * keymap.c (where_is_internal): Doc fix (Bug#10872).
13342 2012-04-27  Glenn Morris  <rgm@gnu.org>
13344         * fileio.c (Fcopy_file, Fset_file_selinux_context):
13345         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
13347 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
13349         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13350         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
13352 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
13354         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13355         display element, check also the underlying string or buffer
13356         character.  (Bug#11341)
13358         * w32menu.c: Include w32heap.h.
13359         (add_menu_item): If the call to AppendMenuW (via
13360         unicode_append_menu) fails, disable Unicode menus only if we are
13361         running on Windows 9X/Me.
13363 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
13365         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13366         (xgetint): Add missing shift for LSB tags.
13368 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
13370         * keyboard.c (read_char): Don't wipe echo area for select window
13371         events: These might get delayed via `mouse-autoselect-window'
13372         (Bug#11304).
13374 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
13376         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13377         manipulation of :loaded-from data.
13379 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
13381         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13382         now a cons (bug#11311).
13384 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
13386         Do not create empty overlays with the evaporate property (Bug#9642).
13387         * buffer.c (Fmove_overlay): Delete an evaporating overlay
13388         if it becomes empty after its bounds are adjusted to fit within
13389         its buffer.  Without this fix, in a nonempty buffer (let ((o
13390         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13391         yields an empty overlay that has the evaporate property, which is
13392         not supposed to happen.
13394         Fix minor GTK3 problems found by static checking.
13395         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13396         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13397         (struct _EmacsFixedClass, emacs_fixed_get_type):
13398         Move decls here from emacsgtkfixed.h, since they needn't be public.
13399         (emacs_fixed_get_type): Now static.
13400         (emacs_fixed_class_init): Omit unused local.
13401         (emacs_fixed_child_type): Remove; unused.
13402         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13403         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13404         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13405         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13406         (EMACS_FIXED_GET_CLASS): Remove; unused.
13407         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13409         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13410         Problem reported by Juanma Barranquero for Windows -Wunused-function.
13412 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
13414         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
13415         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
13416         (__malloc_size_t, __malloc_ptrdiff_t):
13417         Remove.  All uses removed, replaced by the definiens if needed,
13418         since we can assume C89 or better now.
13419         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13420         (protect_malloc_state, align, get_contiguous_space)
13421         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13422         (malloc_atfork_handler_child, malloc_enable_thread)
13423         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13424         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13425         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13426         (special_realloc, _realloc_internal_nolock, _realloc_internal)
13427         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13428         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13429         Define using prototypes, not old style.
13430         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13431         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13432         (align): Don't assume that signed integer overflow wraps around.
13433         Omit unused local var.
13434         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13435         (_free_internal_nolock, memalign, mallochook, reallochook):
13436         Omit no-longer-needed casts.
13437         (valloc): Use getpagesize, not __getpagesize.
13438         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13439         (struct hdr): The 'magic' member is now size_t, not unsigned long.
13441         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13443 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
13445         Move functions from C to Lisp.  Make non-blocking method calls
13446         the default.  Implement further D-Bus standard interfaces.
13448         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13449         (QCdbus_request_name_allow_replacement)
13450         (QCdbus_request_name_replace_existing)
13451         (QCdbus_request_name_do_not_queue)
13452         (QCdbus_request_name_reply_primary_owner)
13453         (QCdbus_request_name_reply_in_queue)
13454         (QCdbus_request_name_reply_exists)
13455         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13456         (QCdbus_registered_serial, QCdbus_registered_method)
13457         (QCdbus_registered_signal): New Lisp objects.
13458         (XD_DEBUG_MESSAGE): Use sizeof.
13459         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13460         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13461         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13462         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13463         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13464         (xd_signature, xd_append_arg): Allow float for integer types.
13465         (xd_get_connection_references): New function.
13466         (xd_get_connection_address): Rename from xd_initialize.
13467         Return cached address.
13468         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13469         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
13470         level.
13471         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
13472         Return number of refcounts.
13473         (Fdbus_get_unique_name): Make stronger parameter check.
13474         (Fdbus_message_internal): New defun.
13475         (Fdbus_call_method, Fdbus_call_method_asynchronously)
13476         (Fdbus_method_return_internal, Fdbus_method_error_internal)
13477         (Fdbus_send_signal, Fdbus_register_service)
13478         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13479         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13480         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13481         (Vdbus_compiled_version, Vdbus_runtime_version)
13482         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13483         (Vdbus_message_type_method_return, Vdbus_message_type_error)
13484         (Vdbus_message_type_signal): New defvars.
13485         (Vdbus_registered_buses, Vdbus_registered_objects_table):
13486         Adapt docstring.
13488 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
13490         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13491         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13492         Do not assume ptrdiff_t is the same width as 'int'.
13494         * alloc.c: Handle unusual debugging option combinations.
13495         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13496         since the two debugging options are incompatible.
13497         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13498         is defined.
13499         (mem_init, mem_insert, mem_insert_fixup):
13500         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13501         (NEED_MEM_INSERT): Remove; no longer needed.
13503 2012-04-22  Leo Liu  <sdl.web@gmail.com>
13505         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13507 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
13509         * sysdep.c [__FreeBSD__]: Minor cleanups.
13510         (list_system_processes, system_process_attributes) [__FreeBSD__]:
13511         Use Emacs indenting style more consistently.  Avoid some casts.
13512         Use 'double' consistently rather than mixing 'float' and 'double'.
13514 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
13516         * sysdep.c (list_system_processes, system_process_attributes):
13517         Add implementation for FreeBSD (Bug#5243).
13519 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
13521         * lisp.mk (lisp): Update.
13523 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
13525         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13526         It is never used otherwise.
13528 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
13530         * print.c (print_preprocess): Only check print_depth if print-circle
13531         is nil.
13532         (print_object): Check for cycles even when print-circle is nil and
13533         print-gensym is t, but only check print_depth if print-circle is nil.
13535 2012-04-20  Chong Yidong  <cyd@gnu.org>
13537         * process.c (wait_reading_process_output): If EIO occurs on a pty,
13538         set the status to "failed" and ensure that sentinel is run.
13540 2012-04-20  Glenn Morris  <rgm@gnu.org>
13542         * process.c (Fset_process_inherit_coding_system_flag)
13543         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
13544         (Fmake_network_process, Fmake_serial_process): Doc fix.
13546 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
13548         * xdisp.c (string_buffer_position_lim): Limit starting position to
13549         BEGV.
13550         (set_cursor_from_row): If called for a mode-line or header-line
13551         row, return zero immediately.
13552         (try_cursor_movement): If inside continuation line, don't back up
13553         farther than the first row after the header line, if any.
13554         Don't consider the header-line row as "partially visible", even if
13555         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
13557 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
13559         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13560         (bug#11238).
13562 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
13563 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
13565         configure: new option --enable-gcc-warnings (Bug#11207)
13566         * Makefile.in (C_WARNINGS_SWITCH): Remove.
13567         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13568         (ALL_CFLAGS): Use new macros rather than old.
13569         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13570         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
13571         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13572         -Wunused-result, -Wunused-variable.  This should go away once
13573         the Emacs and Gnulib regex code is merged.
13574         (xmalloc, xrealloc): Now static.
13576 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
13578         * dired.c (Fsystem_groups): Remove unused local.
13580 2012-04-17  Glenn Morris  <rgm@gnu.org>
13582         * dired.c (Fsystem_users): Doc fix.
13584 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
13586         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
13587         (syms_of_dired): Add them.
13589 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
13591         Fix minor alloc.c problems found by static checking.
13592         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13593         New extern decls, to avoid calling undeclared functions.
13594         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13595         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13596         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13597         (NEED_MEM_INSERT): New macro.
13598         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
13599         Remove one incorrect comment and fix another.
13601         Fix minor ralloc.c problems found by static checking.
13602         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13603         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13604         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13605         (r_alloc_sbrk): Now static.
13607         Improve ralloc.c interface checking.
13608         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13609         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13610         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13611         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13612         [REL_ALLOC]: ... to here, to check interface.
13613         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13614         Remove decls.  This fixes an "It stinks!".
13616         * alloc.c (which_symbols): Fix alignment issue / type clash.
13618 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
13620         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13621         (struct Lisp_Misc_Any): Likewise.
13622         (struct Lisp_Free): Likewise.
13623         * alloc.c (union aligned_Lisp_Symbol): Define.
13624         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13625         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13626         (union aligned_Lisp_Misc): Define.
13627         (MARKER_BLOCK_SIZE, struct marker_block): Use union
13628         aligned_Lisp_Misc instead of union Lisp_Misc.
13629         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
13631 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
13633         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13634         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13635         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13636         * s/netbsd.h, s/sol2-6.h:
13637         Remove definition of GC_MARK_STACK, since the default now works.
13638         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13639         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13640         no longer the default.
13641         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13643 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
13645         * lread.c (lisp_file_lexically_bound_p):
13646         Fix hang at ";-*-\n" (bug#11238).
13648 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
13650         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13651         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
13653 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
13655         * nsterm.m (constrainFrameRect): Always constrain when there is only
13656         one screen (Bug#10962).
13658 2012-04-13  Ken Brown  <kbrown@cornell.edu>
13660         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13662 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
13664         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13666 2012-04-11  Daniel Colascione  <dancol@dancol.org>
13668         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13669         against is gone.  It's better to use vfork now so that when Cygwin
13670         gains a new, working vfork, we use it automatically (bug#10398).
13672 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
13674         * window.c (save_window_save): Obey window-point-insertion-type.
13676 2012-04-11  Glenn Morris  <rgm@gnu.org>
13678         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13680 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
13682         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13684 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
13686         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13687         (force_quit_count): New var.
13688         (handle_interrupt): Use it.
13690 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
13692         * w32.c (w32_delayed_load): Record the full path of the library
13693         being loaded (bug#10424).
13695 2012-04-09  Glenn Morris  <rgm@gnu.org>
13697         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13698         not just in the obarray, before snarfing them.  (Bug#11036)
13700         * Makefile.in ($(leimdir)/leim-list.el):
13701         Pass EMACS rather than BUILT_EMACS.
13703 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
13705         * process.c (make_process):
13706         * process.h: Add integer `gnutls_handshakes_tried' member to
13707         process struct.
13709         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13710         Add convenience `GNUTLS_LOG2i' macro.
13712         * gnutls.c (gnutls_log_function2i): Convenience log function.
13713         (emacs_gnutls_read): Use new log functions,
13714         `gnutls_handshakes_tried' process member, and
13715         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13716         attempts per process (connection).
13718 2012-04-09  Chong Yidong  <cyd@gnu.org>
13720         * eval.c (Fuser_variable_p, user_variable_p_eh)
13721         (lisp_indirect_variable): Functions deleted.
13722         (Fdefvar): Caller changed.
13724         * callint.c (Finteractive, Fcall_interactively):
13725         * minibuf.c (Fread_variable): Callers changed.
13727 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
13729         * xdisp.c (set_cursor_from_row): If the display string appears in
13730         the buffer at position that is closer to point than the position
13731         after the display string, display the cursor on the first glyph of
13732         the display string.  Fixes cursor display when a 'display' text
13733         property immediately follows invisible text.  (Bug#11094)
13735 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
13737         composite.c: use 'double' consistently
13738         * composite.c (get_composition_id): Use 'double' consistently
13739         instead of converting 'float' to 'double' and vice versa; this is
13740         easier to understand and avoids a GCC warning.
13742 2012-04-09  Glenn Morris  <rgm@gnu.org>
13744         * Makefile.in: Generate leim-list with bootstrap-emacs, in
13745         preparation for dumping it with emacs.  (Bug#4789)
13746         (leimdir): New variable.
13747         ($(leimdir)/leim-list.el): New rule.
13748         (emacs$(EXEEXT)): Depend on leim-list.el.
13750         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
13751         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13752         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13754 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
13756         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13757         proper alignment.
13759 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
13761         * xml.c (init_libxml2_functions) [WINDOWSNT]:
13762         Remove unused local variable.
13764 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
13766         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13767         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13768         (mark_memory): Mark Lisp_Objects only if pointers might hide in
13769         objects, as mark_maybe_pointer will catch them otherwise.
13770         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13771         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13773 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
13775         Fix typo that broke non-Windows builds.
13776         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13778 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
13780         Support building on MS-Windows with libxml2.
13782         * makefile.w32-in (OBJ2): Add xml.$(O).
13783         (GLOBAL_SOURCES): Add xml.c.
13784         ($(BLD)/xml.$(O)): New dependency list.
13786         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13787         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13788         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13789         [!WINDOWSNT]: New macros.
13790         (init_libxml2_functions, libxml2_loaded_p): New functions.
13791         (parse_region): Call fn_xmlCheckVersion instead of using the macro
13792         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
13793         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13794         Calls xmlCleanupParser only if libxml2 was loaded (or statically
13795         linked in).
13796         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13797         Call init_libxml2_functions before calling libxml2 functions.
13798         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13800         * emacs.c: Don't include libxml/parser.h.
13801         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13802         xmlCleanupParser directly.
13804         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13806 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
13808         * indent.c (Fvertical_motion): If there is a display string at
13809         point, use it.vpos to compute how many lines to backtrack after
13810         move_it_to point.  (Bug#11133)
13812 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
13814         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13815         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13816         about subtle differences between FETCH_CHAR* and STRING_CHAR*
13817         macros related to unification of CJK characters.  For the details,
13818         see the discussion following the message here:
13819         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13821 2012-04-04  Chong Yidong  <cyd@gnu.org>
13823         * keyboard.c (Vdelayed_warnings_list): Doc fix.
13825 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
13827         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13828         instead of alloca.  (Bug#11138)
13830 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
13832         * w32menu.c (is_simple_dialog): Properly check lisp types.
13833         (Bug#11141)
13835 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
13837         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13838         position we get to after a call to move_it_to fails the
13839         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13840         only if we wind up in a string from display property.  (Bug#11063)
13842         * window.c (Fdelete_other_windows_internal): Invalidate the row
13843         and column information about mouse highlight, so that redisplay
13844         restores it after reallocating the glyph matrices.  (Bug#7464)
13846         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13847         string comes from a `display' text property, use the buffer
13848         position of that property as if we actually saw that position in
13849         the row's glyphs.
13850         (move_it_by_lines): Remove the assertion that
13851         "it->current_x == 0 && it->hpos == 0" which can be legitimately
13852         violated when there's a before-string at the beginning of a line.
13853         (Bug#11063)
13855 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
13857         * xdisp.c (append_space_for_newline): If the default face was
13858         remapped, use the remapped face for the appended newline.
13859         (extend_face_to_end_of_line): Use the remapped default face for
13860         extending the face to the end of the line.
13861         (display_line): Call extend_face_to_end_of_line when the default
13862         face was remapped.  (Bug#11068)
13864 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
13866         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13868 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
13870         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13872 2012-03-27  Glenn Morris  <rgm@gnu.org>
13874         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13875         Doc fixes.
13877 2012-03-26  Kenichi Handa  <handa@m17n.org>
13879         * dispextern.h (struct glyph): Fix previous change.  Change the
13880         bit length of glyphless.ch to 25 (Bug#11082).
13882 2012-03-26  Chong Yidong  <cyd@gnu.org>
13884         * keyboard.c (Vselection_inhibit_update_commands): New variable.
13885         (command_loop_1): Use it; inhibit selection update for
13886         handle-select-window too (Bug#8996).
13888 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
13890         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
13892 2012-03-25  Kenichi Handa  <handa@m17n.org>
13894         * dispextern.h (struct glyph): Change the bit length of
13895         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13897 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
13899         * s/ms-w32.h (tzname): Include time.h before redirecting to
13900         _tzname.  Fixes the MSVC build.  (Bug#9960)
13902 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
13904         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13905         characters.
13907         * xterm.c (XTread_socket): Only modify handling_signal if
13908         !SYNC_INPUT.  (Bug#11080)
13910 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
13912         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13913         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
13914         when fetching a multibyte character consumes more bytes than
13915         CHAR_BYTES returns, due to unification of CJK characters in
13916         string_char.  (Bug#11073)
13918 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
13920         * process.c (wait_reading_process_output): Handle pty disconnect
13921         by refraining from sending oneself a SIGCHLD (bug#10933).
13923 2012-03-22  Chong Yidong  <cyd@gnu.org>
13925         * dispextern.h (struct it): New member string_from_prefix_prop_p.
13927         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
13928         Mark string as coming from a prefix property.
13929         (handle_face_prop): Use default face for prefix strings (Bug#4281).
13930         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13932 2012-03-21  Chong Yidong  <cyd@gnu.org>
13934         * xfaces.c (Vface_remapping_alist): Doc fix.
13936 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
13938         * w32proc.c (Fw32_set_console_codepage)
13939         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13940         Doc fixes.
13942 2012-03-20  Chong Yidong  <cyd@gnu.org>
13944         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13945         to reflect default non-nil value of redisplay-dont-pause.
13947 2012-03-19  Kenichi Handa  <handa@m17n.org>
13949         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13950         it fit in a valid range (Bug#11003).
13952 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
13954         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13955         that is not from display property, accept the row as a "cursor
13956         row" if one of the string's character has a non-nil `cursor'
13957         property.  Fixes cursor positioning when there are newlines in
13958         overlay strings, e.g. in icomplete.el.  (Bug#11035)
13960 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
13962         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13964 2012-03-12  Chong Yidong  <cyd@gnu.org>
13966         * eval.c (inhibit_lisp_code): Rename from
13967         inhibit_window_configuration_change_hook; move from window.c.
13969         * xfns.c (unwind_create_frame_1, Fx_create_frame):
13970         * window.c (run_window_configuration_change_hook)
13971         (syms_of_window): Callers changed.
13973 2012-03-11  Chong Yidong  <cyd@gnu.org>
13975         * keymap.c (Fkey_description): Doc fix (Bug#9700).
13977         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13979 2012-03-10  Chong Yidong  <cyd@gnu.org>
13981         * frame.c (other_visible_frames): Don't assume the selected frame
13982         is visible (Bug#10955).
13984 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
13986         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13988 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
13990         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13991         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13992         zero (Bug#10954).
13994 2012-03-03  Glenn Morris  <rgm@gnu.org>
13996         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
13998 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
14000         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14001         position past the first glyph_row that ends at ZV.  (Bug#10902)
14002         (redisplay_window, next_element_from_string): Fix typos in
14003         comments.
14004         (redisplay_window): Pass to move_it_vertically the margin in
14005         pixels, not in screen lines.
14007 2012-03-02  Glenn Morris  <rgm@gnu.org>
14009         * buffer.c (buffer-list-update-hook): Doc fix.
14011 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
14013         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14014         push_it before setting up the iterator for the first overlay
14015         string, even if we have an empty string loaded.
14016         (next_overlay_string): If there's an empty string on the iterator
14017         stack, pop the stack.  (Bug#10903)
14019 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
14021         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14022         Suggested by Stefan Monnier in
14023         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14024         * alloc.c (widen_to_Lisp_Object): New static function.
14025         (mark_memory): Also mark Lisp_Objects by fetching pointer words
14026         and widening them to Lisp_Objects.  This would work even if
14027         USE_LSB_TAG is defined and wide integers are used, which might
14028         happen in a future version of Emacs.
14030 2012-02-25  Chong Yidong  <cyd@gnu.org>
14032         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14033         Doc fix.
14035         * xselect.c (Fx_selection_exists_p): Doc fix.
14036         (x_clipboard_manager_save_all): Print an informative message
14037         before saving to clipboard manager.
14039 2012-02-24  Chong Yidong  <cyd@gnu.org>
14041         * keyboard.c (process_special_events): Handle all X selection
14042         requests in kbd_buffer, not just the next one (Bug#8869).
14044 2012-02-23  Chong Yidong  <cyd@gnu.org>
14046         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14047         call when setting menu-bar-lines and tool-bar-lines parameters.
14048         (unwind_create_frame_1): New helper function.
14050         * window.c (inhibit_window_configuration_change_hook): New var.
14051         (run_window_configuration_change_hook): Obey it.
14052         (syms_of_window): Initialize it.
14054 2012-02-22  Chong Yidong  <cyd@gnu.org>
14056         * xterm.c (x_draw_image_relief): Add missing type check for
14057         Vtool_bar_button_margin (Bug#10743).
14059 2012-02-21  Chong Yidong  <cyd@gnu.org>
14061         * fileio.c (Vfile_name_handler_alist): Doc fix.
14063         * buffer.c (Fget_file_buffer): Protect against invalid file
14064         handler return value.
14066 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
14068         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14069         when computing $valmask.
14071         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14072         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14073         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14074         It's useless in that case, and it can cause problems on hosts
14075         that allocate halves of EMACS_INT values separately.
14076         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
14077         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14078         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14079         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
14080         it avoids undefined behavior on hosts where shifting right by more
14081         than the word width has undefined behavior.
14083 2012-02-19  Chong Yidong  <cyd@gnu.org>
14085         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14086         (Funhandled_file_name_directory, Ffile_name_as_directory)
14087         (Fdirectory_file_name, Fexpand_file_name)
14088         (Fsubstitute_in_file_name): Protect against invalid file handler
14089         return values (Bug#10845).
14091 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
14093         * .gdbinit (pitx): Fix incorrect references to fields of the
14094         iterator stack.
14096 2012-02-17  Chong Yidong  <cyd@gnu.org>
14098         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14100 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
14102         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14103         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14105 2012-02-15  Chong Yidong  <cyd@gnu.org>
14107         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14108         marked as special.  Also, starting docstrings with * is obsolete.
14110 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
14112         * gnutls.c (emacs_gnutls_write): Fix last change.
14114 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
14116         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14117         send_process.
14119 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
14121         * keymap.c (Fsingle_key_description): Handle char ranges.
14123 2012-02-12  Chong Yidong  <cyd@gnu.org>
14125         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14126         as that creates a dangerous corner case.
14128         * window.c (Fdelete_window_internal): Invalidate the mouse
14129         highlight (Bug#9904).
14131 2012-02-12  Glenn Morris  <rgm@gnu.org>
14133         * xselect.c (Fx_own_selection_internal)
14134         (Fx_get_selection_internal, Fx_disown_selection_internal)
14135         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14136         * nsselect.m (Fx_own_selection_internal)
14137         (Fx_disown_selection_internal, Fx_selection_exists_p)
14138         (Fx_selection_owner_p, Fx_get_selection_internal):
14139         Sync docs and argument specs with the xselect.c versions.
14141 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
14143         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14145 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
14147         * w32select.c (Fx_selection_exists_p): Sync doc string and
14148         argument list with xselect.c.  (Bug#10783)
14150         * w16select.c (Fx_selection_exists_p): Sync doc string and
14151         argument list with xselect.c.  (Bug#10783)
14153 2012-02-10  Glenn Morris  <rgm@gnu.org>
14155         * fns.c (Fsecure_hash): Doc fix.
14157 2012-02-09  Kenichi Handa  <handa@m17n.org>
14159         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14161 2012-02-07  Chong Yidong  <cyd@gnu.org>
14163         * buffer.c (Fbuffer_local_variables)
14164         (buffer_lisp_local_variables): Handle unbound vars correctly;
14165         don't let Qunbound leak into Lisp.
14167 2012-02-07  Glenn Morris  <rgm@gnu.org>
14169         * image.c (Fimagemagick_types): Doc fix.
14171         * image.c (imagemagick-render-type): Change it from a lisp object
14172         to an integer.  Move the doc here from the lisp manual.
14173         Treat all values not equal to 0 the same.
14175 2012-02-06  Chong Yidong  <cyd@gnu.org>
14177         * doc.c (store_function_docstring): Avoid applying docstring of
14178         alias to base function (Bug#2603).
14180 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
14182         * .gdbinit (pp1, pv1): Remove redundant defines.
14183         (pr): Use pp.
14185 2012-02-04  Chong Yidong  <cyd@gnu.org>
14187         * nsterm.m: Declare a global (Bug#10694).
14189 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
14191         * w32.c (get_emacs_configuration_options):
14192         Include --enable-checking, if specified, in the return value.
14194 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
14196         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14197         after rounding frame sizes.  (Bug#9723)
14199 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
14201         * keyboard.c (adjust_point_for_property): Don't position point
14202         before BEGV.  (Bug#10696)
14204 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
14206         Handle overflow when computing char display width (Bug#9496).
14207         * character.c (char_width): Return EMACS_INT, not int.
14208         (char_width, c_string_width): Check for overflow when
14209         computing the width; this is possible now that individual
14210         characters can have unbounded width.  Problem introduced
14211         by merge from Emacs 23 on 2012-01-19.
14213 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
14215         * dbusbind.c (Fdbus_register_method): Mention the return value
14216         :ignore in the docstring.
14218 2012-02-02  Glenn Morris  <rgm@gnu.org>
14220         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14222         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14223         Unconditionally set to t.  (Bug#10673)
14224         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14225         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14226         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14228 2012-02-02  Kenichi Handa  <handa@m17n.org>
14230         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
14231         0, do not call append_composite_glyph.
14233 2012-02-02  Kenichi Handa  <handa@m17n.org>
14235         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14236         NULL (Bug#6988).
14237         (x_produce_glyphs): If the component of a composition is a null
14238         string, set it->pixel_width to 1 to avoid zero-width glyph.
14240 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
14242         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14243         first 2 arguments are identical.  This makes inserting large
14244         output from a subprocess an order of magnitude faster on
14245         MS-Windows, where all sbrk'ed memory is always contiguous.
14247 2012-01-31  Glenn Morris  <rgm@gnu.org>
14249         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14250         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14251         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14253 2012-01-29  Glenn Morris  <rgm@gnu.org>
14255         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14257 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
14259         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14261 2012-01-28  Chong Yidong  <cyd@gnu.org>
14263         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14265 2012-01-26  Chong Yidong  <cyd@gnu.org>
14267         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14269         * search.c (Fsearch_forward, Fsearch_backward): Document negative
14270         repeat counts (Bug#10507).
14272 2012-01-26  Glenn Morris  <rgm@gnu.org>
14274         * lread.c (syms_of_lread): Doc fix.
14276 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
14278         * coding.c (encode_designation_at_bol): Change return value to
14279         EMACS_INT.
14281 2012-01-25  Chong Yidong  <cyd@gnu.org>
14283         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14285 2012-01-21  Chong Yidong  <cyd@gnu.org>
14287         * floatfns.c (Fcopysign): Make the second argument non-optional,
14288         since nil is not allowed anyway.
14290 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
14292         * process.c (read_process_output): Use p instead of XPROCESS (proc).
14293         (send_process): Likewise.
14295 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
14297         * window.c (save_window_save, Fcurrent_window_configuration)
14298         (Vwindow_persistent_parameters): Do not use Qstate.
14299         Rewrite doc-strings.
14301 2012-01-19  Kenichi Handa  <handa@m17n.org>
14303         * character.c (char_width): New function.
14304         (Fchar_width, c_string_width, lisp_string_width):
14305         Use char_width (Bug#9496).
14307 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
14309         * window.c (Vwindow_persistent_parameters): New variable.
14310         (Fset_window_configuration, save_window_save): Handle persistent
14311         window parameters.
14313 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
14315         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14316         thrashing the stack of the thread.  (Bug#9087)
14318 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
14320         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14322 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
14324         * xdisp.c (rows_from_pos_range): Handle the case where the
14325         highlight ends on a newline.  (Bug#10464)
14326         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14327         he end column for display of highlight that ends on a newline
14328         before a R2L line.
14330 2012-01-11  Glenn Morris  <rgm@gnu.org>
14332         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14333         from load-path also when installation-directory is nil.  (Bug#10208)
14335 2012-01-10  Glenn Morris  <rgm@gnu.org>
14337         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14339         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14340         Update template values to be closer to their typical values these days.
14342 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
14344         * xdisp.c (rows_from_pos_range): Accept additional argument
14345         DISP_STRING, and accept any glyph in a row whose object is that
14346         string as eligible for mouse highlight.  Fixes mouse highlight of
14347         display strings from overlays.  (Bug#10464)
14349 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
14351         emacs: fix an auto-save permissions race condition (Bug#10400)
14352         * fileio.c (auto_saving_dir_umask): New static var.
14353         (Fmake_directory_internal): Use it.
14354         (do_auto_save_make_dir): Set it, instead of invoking chmod after
14355         creating the directory.  The old code temporarily assigns
14356         too-generous permissions to the directory.
14357         (do_auto_save_eh): Clear it.
14358         (Fdo_auto_save): Catch all errors, not just file errors, so
14359         that the var is always cleared.
14361 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
14363         * search.c (scan_buffer): Pass character positions to
14364         know_region_cache, not byte positions.  (Bug#6540)
14366 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
14368         * w32.c (sys_rename): Report EXDEV when rename of a directory
14369         fails because the target is on another logical disk.  (Bug#10284)
14371 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
14373         * xterm.c (x_embed_request_focus): New function.
14375         * xterm.h: Add prototype.
14377         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14379 2012-01-05  Glenn Morris  <rgm@gnu.org>
14381         * emacs.c (emacs_copyright): Update short copyright year to 2012.
14383 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
14385         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14386         Load gnutls_transport_set_lowat only if GnuTLS version is below
14387         2.11.1.
14388         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14389         GnuTLS versions below 2.11.1.
14391 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
14393         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14394         to the doc string advising against its use for altering the way
14395         windows are scrolled.
14397 2011-12-28  Kenichi Handa  <handa@m17n.org>
14399         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14400         coding-system ASCII compatible only when it does not produce BOM
14401         on encoding (Bug#10383).
14403 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
14405         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14406         can scroll.
14407         (create_and_show_popup_menu): Always use menu_position_func for
14408         Gtk3 (Bug#10361).
14410 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
14412         * callint.c (Fcall_interactively): Don't truncate prompt string.
14414 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
14416         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14417         property that ends at ZV, so that the bidi iteration could be
14418         resumed from there (after widening).  (Bug#10360)
14420 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
14422         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14424 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
14426         * nsterm.m (x_free_frame_resources):
14427         Release f->output_data.ns->miniimage.
14428         (ns_index_color): Fix indentation.  Do not retain
14429         color_table->colors[i].
14431         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14432         before returning.
14434         * nsfns.m (x_set_background_color): Assign return value from
14435         ns_index_color to face-background instead of NSColor*.
14436         (ns_implicitly_set_icon_type): Fix indentation.
14437         Change assignment in for loop to comparison.
14439         * emacs.c (ns_pool): New variable.
14440         (main): Assign ns_pool.
14441         (Fkill_emacs): Call ns_release_autorelease_pool.
14443         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14444         autorelease fdesc, release fdAttrs and tdict.
14445         (ns_get_covering_families): Release charset.
14446         (ns_findfonts): Release NSFontDescriptor created with new.
14447         (ns_uni_to_glyphs): Fix indentation.
14448         (setString): Release attrStr before assigning new value.
14450 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
14452         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14453         and NS_IMPL_COCOA.
14454         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14455         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14457 2011-12-18  David Reitter  <reitter@cmu.edu>
14459         * nsterm.m (ns_term_init): Subscribe for notifications
14460         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14461         to method trackingNotification in EmacsMenu.
14463         * nsmenu.m (trackingMenu): New variable.
14464         (trackingNotification): New method (from Aquamacs).
14465         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
14466         from Aquamacs (Bug#7030).
14468 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
14470         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14471         (symbol_to_nsstring): Fix indentation.
14472         (ns_symbol_to_pb): New function.
14473         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14474         (Fns_rotate_cut_buffers_internal): Remove.
14475         (Fns_store_selection_internal): Rename from
14476         Fns_store_cut_buffer_internal.
14477         (ns_get_foreign_selection, Fx_own_selection_internal)
14478         (Fx_disown_selection_internal, Fx_selection_exists_p)
14479         (Fns_get_selection_internal, Fns_store_selection_internal):
14480         Use ns_symbol_to_pb and check if return value is nil.
14481         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
14482         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
14483         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14484         renamed to Sns_store_selection_internal.
14485         (ns_handle_selection_request): Move code to Fx_own_selection_internal
14486         and remove this function.
14487         (ns_handle_selection_clear): Remove, never used.
14488         (Fx_own_selection_internal): Move code from ns_handle_selection_request
14489         here.
14491 2011-12-17  Ken Brown  <kbrown@cornell.edu>
14493         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14494         GID is unknown (Bug#10257).
14496 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
14498         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14499         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14500         which caused a build failure on GNU/Linux IA-64.  This problem was
14501         introduced by my 2011-10-07 patch.
14503 2011-12-15  Juri Linkov  <juri@jurta.org>
14505         * image.c (imagemagick_error): New function.  (Bug#10112)
14506         (imagemagick_load_image): Comment out `MagickSetResolution' call.
14507         Use `imagemagick_error' where ImageMagick functions return
14508         `MagickFalse'.
14509         (Fimagemagick_types): Add `Fnreverse' to return the list in the
14510         proper order.
14512 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14514         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14515         fill background (Bug#8992).
14517 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
14519         * window.c (Vwindow_combination_resize)
14520         (Vwindow_combination_limit): Use t instead of non-nil in
14521         doc-strings.
14522         (Vrecenter_redisplay): Add first sentence of doc-string on
14523         separate line.
14524         (Frecenter): Fix doc-string typo.
14526 2011-12-11  Kenichi Handa  <handa@m17n.org>
14528         * coding.c (Funencodable_char_position): Pay attention to the
14529         buffer text relocation (Bug#9389).
14531 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
14533         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14534         gtk_init (Bug#10100).
14536 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
14538         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14539         IT->string is nil.  (Bug#10263)
14541 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
14543         * nsterm.h (x_free_frame_resources): Declare.
14545         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14546         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14548         * nsterm.h (ns_get_defaults_value): Declare.
14550         * nsterm.m (ns_default): Call ns_get_defaults_value.
14552 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
14554         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14555         (Bug#10170)
14557 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14559         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14560         that where the value of an _OBJC_* symbol points to is in the .bss
14561         section (Bug#10240).
14563 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
14565         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
14566         after the loop to call ccl_driver at least once (Bug#8619).
14568 2011-12-08  Kenichi Handa  <handa@m17n.org>
14570         * ftfont.c (get_adstyle_property): Fix previous change
14571         (Bug#10233).
14573 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
14575         * w32.c (init_environment): If no_site_lisp, remove site-lisp
14576         dirs from the default value of EMACSLOADPATH (bug#10208).
14578 2011-12-07  Glenn Morris  <rgm@gnu.org>
14580         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14581         installation and source directories as well.  (Bug#10208)
14583 2011-12-06  Chong Yidong  <cyd@gnu.org>
14585         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14587 2011-12-06  Glenn Morris  <rgm@gnu.org>
14589         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14590         as an error, not just -1.  (Bug#10217)
14592 2011-12-05  Chong Yidong  <cyd@gnu.org>
14594         * keyboard.c (process_special_events): New function.
14595         (swallow_events, Finput_pending_p): Use it (Bug#10195).
14597 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
14599         * coding.c (encode_designation_at_bol): Don't use uninitialized
14600         local variable (Bug#9318).
14602 2011-12-05  Kenichi Handa  <handa@m17n.org>
14604         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14605         return Qnil (Bug#8046, Bug#10193).
14607 2011-12-05  Kenichi Handa  <handa@m17n.org>
14609         * coding.c (encode_designation_at_bol): New args charbuf_end and
14610         dst.  Return the number of produced bytes.  Callers changed.
14611         (coding_set_source): Return how many bytes coding->source was
14612         relocated.
14613         (coding_set_destination): Return how many bytes
14614         coding->destination was relocated.
14615         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
14616         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
14618 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
14620         * coding.c (CODING_CHAR_CHARSET_P): New macro.
14621         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14622         macro (Bug#9318).
14624 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
14626         The following changes are to fix Bug#9318.
14628         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
14629         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14630         (encode_coding_iso_2022, encode_coding_sjis)
14631         (encode_coding_big5, encode_coding_charset): Use the above macros.
14633 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
14635         * lisp.h (process_quit_flag): Fix external declaration.
14637 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
14639         Don't macro-inline non-performance-critical code.
14640         * eval.c (process_quit_flag): New function.
14641         * lisp.h (QUIT): Use it.
14643 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
14645         * nsfns.m (get_geometry_from_preferences): New function.
14646         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14648 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
14650         * emacs.c (Qkill_emacs): Define.
14651         (syms_of_emacs): Initialize it.
14652         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14653         Qquit_flag to `kill-emacs' instead.
14654         (quit_throw_to_read_char): Add parameter `from_signal'.
14655         All callers changed.  Call Fkill_emacs if requested and safe.
14656         * lisp.h (QUIT): Call Fkill_emacs if requested.
14658 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
14660         * widget.c (update_wm_hints): Return if wmshell is null.
14661         (widget_update_wm_size_hints): New function.
14663         * widget.h (widget_update_wm_size_hints): Declare.
14665         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14666         widget_update_wm_size_hints (Bug#10104).
14668 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
14670         * xdisp.c (handle_invisible_prop): If the invisible text ends just
14671         before a newline, prepare the bidi iterator for consuming the
14672         newline, and keep the current paragraph direction.  (Bug#10183)
14673         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
14675 2011-12-02  Juri Linkov  <juri@jurta.org>
14677         * search.c (Fword_search_regexp): New Lisp function created from
14678         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
14679         (Fword_search_backward, Fword_search_forward)
14680         (Fword_search_backward_lax, Fword_search_forward_lax):
14681         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
14682         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
14684 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
14686         * fileio.c (Finsert_file_contents): Move after-change-function call
14687         to before the "handled:" label, since all "goto handled" appear in
14688         cases where the *-change-functions have already been properly called
14689         (bug#10117).
14691 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
14693         * keyboard.c (interrupt_signal): Don't call kill-emacs when
14694         waiting for input.  (Bug#10169)
14696 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
14698         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14699         verifies glyph row's hash code--we have just reallocated the
14700         glyphs, so their contents can be complete garbage.  (Bug#10164)
14702 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
14704         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14706 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
14708         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14709         attributes are tested _before_ calling verify_row_hash, to protect
14710         against GCC re-ordering of the tests.  (Bug#10164)
14712 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
14714         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14716         * xterm.c (handle_one_xevent): Only set async_visible and friends
14717         if net_wm_state_hidden_seen is non-zero (Bug#10002)
14718         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
14719         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14721 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
14723         Remove GCPRO-related macros that exist only to avoid shadowing locals.
14724         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14725         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
14726         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14727         All uses changed to use GCPRO1 etc.
14728         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14729         Revert to old implementation (i.e., before 2011-03-11).
14731 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14733         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14734         of scroll runs so as to avoid assigning disabled bogus rows and
14735         unnecessary graphics copy operations.
14737 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
14739         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14740         (snprintf) [_MSC_VER]: Redirect to _snprintf.
14741         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14742         (malloc, free, realloc, calloc): Redirect to e_* only when
14743         compiling Emacs.
14745         * lisp.h (GCTYPEBITS): Move before first use.
14746         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14747         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14748         this macro definition.
14750         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14751         _MSC_VER.
14753 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
14755         * gtkutil.c (xg_create_frame_widgets):
14756         Call gtk_window_set_has_resize_grip (FALSE) if that function is
14757         present with Gtk+ 2.0.
14759 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
14761         * fileio.c (Finsert_file_contents): Undo previous change; see
14762         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14764 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
14766         Rename locals to avoid shadowing.
14767         * fileio.c (Finsert_file_contents):
14768         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14769         * process.c (wait_reading_process_output):
14770         Rename inner 'proc' to 'p' to avoid shadowing.
14771         Indent for consistency with usual Emacs style.
14773 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
14775         * xdisp.c (redisplay_window): If cursor row is not fully visible
14776         after recentering, and scroll-conservatively is set to a large
14777         number, scroll window by a few more lines to make the cursor fully
14778         visible and out of scroll-margin.  (Bug#10105)
14779         (start_display): Don't move to the next line if the display should
14780         start at a newline that is part of a display vector or an overlay
14781         string.  (Bug#10119)
14783 2011-11-24  Juri Linkov  <juri@jurta.org>
14785         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14786         after the `MagickPingImage' call.  (Bug#10112)
14788 2011-11-23  Chong Yidong  <cyd@gnu.org>
14790         * window.c (Fcoordinates_in_window_p): Accept only live windows.
14792 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
14794         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14795         making another buffer current.  (Bug#10114)
14797 2011-11-23  Glenn Morris  <rgm@gnu.org>
14799         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
14801 2011-11-23  Chong Yidong  <cyd@gnu.org>
14803         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14804         using it (Bug#5984).
14806 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
14808         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14809         and header-lines, as they don't have one computed for them.
14810         (Bug#10098)
14812         * .gdbinit (prow): Make displayed values more self-explaining.
14813         Add row's hash code.
14815 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14817         * process.c (wait_reading_process_output): Fix asynchrounous
14818         GnuTLS socket handling on some versions of the GnuTLS library.
14819         (wait_reading_process_output): Add comment and URL.
14821 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
14823         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14825 2011-11-21  Chong Yidong  <cyd@gnu.org>
14827         * window.c (Fnext_window, Fprevious_window): Doc fix.
14829 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
14831         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14833 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
14835         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14837 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
14839         * window.c (Fset_window_combination_limit): Rename argument
14840         STATUS to LIMIT.
14841         (Vwindow_combination_limit): Remove "status" from doc-string.
14843 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
14845         * m/ibms390.h: Remove.
14846         * m/ibms390x.h: Don't include "ibms390.h".
14848 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
14850         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14851         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14853 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
14855         * casetab.c (Fset_case_table):
14856         * charset.c (Fcharset_after): Fix typos.
14858 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
14860         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14861         Otherwise, valgrind does not work on some platforms.
14862         Problem reported by Andreas Schwab in
14863         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14864         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14865         is set, removing the need for VIRT_ADDRESS_VARIES.
14866         (PURE_P): Use a more-efficient implementation that needs just one
14867         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14868         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14869         to 4 (xorl, subq, cmpq, setbe).
14870         * alloc.c (pure): Always extern now, since that's the
14871         VIRT_ADDR_VARIES behavior.
14872         (PURE_POINTER_P): Use a single comparison, not two, for
14873         consistency with the new puresize.h.
14874         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14875         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14876         Remove VIRT_ADDR_VARIES no longer needed.
14878 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
14880         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14881         (erase_phys_cursor, update_window_cursor, show_mouse_face)
14882         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14883         behave as if the cursor position were at the window margin.
14885         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14886         and the cursor position is out of bounds, behave as if the cursor
14887         position were at the window margin.  (Bug#10075)
14889 2011-11-18  Chong Yidong  <cyd@gnu.org>
14891         * window.c (Fwindow_combination_limit): Make first argument
14892         non-optional, since it is meaningless for live windows like the
14893         selected window.
14895 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
14897         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14899 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
14901         * intervals.c: Fix grafting over the whole buffer (bug#10071).
14902         (graft_intervals_into_buffer): Simplify.
14904 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
14906         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14907         hash values of the two rows.
14908         (copy_row_except_pointers): Preserve the used[] arrays and the
14909         hash values of the two rows.  (Bug#10035)
14910         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
14912         * xdisp.c (row_hash): New function, body extracted from
14913         compute_line_metrics.
14914         (compute_line_metrics): Call row_hash, instead of computing the
14915         hash code inline.
14917         * dispnew.c (verify_row_hash): Call row_hash for computing the
14918         hash code of a row, instead of duplicating code from xdisp.c.
14920         * dispextern.h (row_hash): Add prototype.
14922 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
14924         * frame.c (delete_frame): Don't delete the terminal when the last
14925         X frame is closed if emacs is built with GTK toolkit.
14927 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
14929         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14931 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
14933         * window.c (Vwindow_splits): Rename to
14934         Vwindow_combination_resize.  Suggested by Juri Linkov.
14935         (Fsplit_window_internal): Use Vwindow_combination_resize instead
14936         of Vwindow_splits.
14938 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
14940         * nsfns.m (Fns_font_name):
14941         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
14943 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
14945         * window.h (window): Rename slot "nest" to "combination_limit".
14946         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14947         (Fset_window_nest): Rename to Fset_window_combination_limit.
14948         (Vwindow_nest): Rename to Vwindow_combination_limit.
14949         (recombine_windows, make_parent_window, make_window)
14950         (Fsplit_window_internal, saved_window)
14951         (Fset_window_configuration, save_window_save): Rename all
14952         occurrences of window_nest to window_combination_limit.
14954 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
14956         * image.c (imagemagick_load_image): Fix typo.
14958 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
14960         * xdisp.c (display_line): Move the call to
14961         highlight_trailing_whitespace before the call to
14962         compute_line_metrics, since the latter needs to see the final
14963         faces of all the glyphs to compute ROW's hash value.
14964         Fixes assertion violations in row_equal_p.  (Bug#10035)
14966 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
14968         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14969         just return (bug#10044).
14971 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
14973         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14974         with user-defined heap size.  Bump the default size of the temacs
14975         heap to 27MB, to avoid memory warning when running temacs.
14976         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14978         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14979         current_matrix and desired_matrix.  (Bug#9990)
14980         (verify_row_hash) [XASSERTS]: New function.
14981         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14982         that the hash value of glyph rows is correct.
14984 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
14986         * window.h (window): Remove splits slot.
14987         * window.c (Fwindow_splits, Fset_window_splits): Remove.
14988         (Fdelete_other_windows_internal, make_parent_window)
14989         (make_window, Fsplit_window_internal, Fdelete_window_internal)
14990         (Fset_window_configuration, save_window_save): Don't deal with
14991         split status of windows.
14992         (saved_window): Remove splits slot.
14993         (Vwindow_splits): Rewrite doc-string.
14995 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
14997         * xfns.c (unwind_create_frame):
14998         * nsfns.m (unwind_create_frame):
14999         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15000         Vframe_list (Bug#9999).
15002 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
15004         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
15006 2011-11-11  Kenichi Handa  <handa@m17n.org>
15008         * callproc.c (Fcall_process): Set the member dst_multibyte of
15009         process_coding.
15011 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
15013         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15014         avoid a crash (bug#9496).
15016 2011-11-09  Chong Yidong  <cyd@gnu.org>
15018         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15019         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15021 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
15023         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15025 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
15027         Avoid some portability problems by eschewing 'extern inline' functions.
15028         The trivial performance wins aren't worth the portability hassles; see
15029         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15030         et seq.
15031         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15032         (window_box_width, window_box_left, window_box_left_offset)
15033         (window_box_right, window_box_right_offset): Undo previous change,
15034         by removing the "extern"s.
15035         * intervals.c (adjust_intervals_for_insertion)
15036         (adjust_intervals_for_deletion): Undo previous change,
15037         making these static again.
15038         (offset_intervals, temp_set_point_both, temp_set_point)
15039         (copy_intervals_to_string): No longer inline.
15040         * xdisp.c (window_text_bottom_y, window_box_width)
15041         (window_box_height, window_box_left_offset)
15042         (window_box_right_offset, window_box_left, window_box_right)
15043         (window_box): No longer inline.
15045 2011-11-08  Chong Yidong  <cyd@gnu.org>
15047         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
15048         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15049         Signal an error if not a live window.
15050         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15051         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15053 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
15055         * lisp.h (syms_of_abbrev): Remove declaration.
15056         Reported by CHENG Gao <chenggao@royau.me>.
15058 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
15060         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15061         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
15062         of temacs in GUI mode.
15064 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
15066         * window.h: Declare delete_all_child_windows instead of
15067         delete_all_subwindows.
15068         * window.c (Fwindow_nest, Fset_window_nest)
15069         (Fset_window_new_total, Fset_window_new_normal)
15070         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15071         (delete_all_subwindows): Rename to delete_all_child_windows.
15072         (Fdelete_other_windows_internal, Fset_window_configuration):
15073         Call delete_all_child_windows instead of delete_all_subwindows.
15074         * frame.c (delete_frame): Call delete_all_child_windows instead
15075         of delete_all_subwindows.
15077 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
15079         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15080         This is also needed for porting to any host where GC_MARK_STACK is
15081         not GC_MAKE_GCPROS_NOOPS.
15082         (which_symbols): Use it.
15084 2011-11-07  Kenichi Handa  <handa@m17n.org>
15086         * coding.c (coding_set_destination): Check coding->src_pos only
15087         when coding->src_object is a buffer (bug#9910).
15089         * process.c (send_process): Set the member src_multibyte of coding
15090         to 0 (bug#9911) when sending a unibyte text.
15092         * callproc.c (Fcall_process): Set the member src_multibyte of
15093         process_coding to 0 (bug#9912).
15095 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15097         * xmenu.c (cleanup_widget_value_tree): New function.
15098         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15099         calling free_menubar_widget_value_tree directly (Bug#9830).
15101 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
15103         Fix some portability problems with 'inline'.
15104         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15105         (window_box_width, window_box_left, window_box_left_offset)
15106         (window_box_right, window_box_right_offset): Declare extern.
15107         Otherwise, these inline functions do not conform to C99 and
15108         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
15109         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15110         * intervals.c (adjust_intervals_for_insertion)
15111         (adjust_intervals_for_deletion): Now extern, because otherwise the
15112         extern inline functions 'offset_intervals' couldn't refer to it.
15113         (static_offset_intervals): Remove.
15114         (offset_intervals): Rewrite using the old contents of
15115         static_offset_intervals.  The old version didn't conform to C99
15116         because an extern inline function contained a reference to an
15117         identifier with static linkage.
15119 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
15121         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15122         GC.
15124 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
15126         * xdisp.c (init_iterator, reseat_to_string): Don't set the
15127         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
15128         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15129         return Qleft_to_right.
15131 2011-11-06  Chong Yidong  <cyd@gnu.org>
15133         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15134         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15135         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15136         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15137         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15138         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15139         (Fwindow_vscroll): Doc fix.
15140         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15141         argument, since it makes no sense to pass a live window and for
15142         consistency with window-child.
15144 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
15146         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15147         support MSVC.
15149 2011-11-05  Jason Rumney  <jasonr@gnu.org>
15151         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15152         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15153         fonts (Bug#6029).
15154         (add_font_entity_to_list): Fix logic errors in mixed boolean and
15155         bitwise arithmetic preventing use of unicode-sip and non-truetype
15156         opentype fonts.
15158 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
15160         * s/ms-w32.h (fstat, stat, utime): Move redirections to
15161         "emacs"-only part.
15163         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15164         initialization code to keep similarity to xfns.c after changes
15165         from 2011-11-05.
15167 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
15169         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15170         (unwind_create_frame): New function (Bug#9943).
15171         (Fx_create_frame): Restructure code to be more similar to the one in
15172         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
15173         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15174         Move terminal->reference_count++ just before making the frame official
15175         (Bug#9943).
15177         * nsterm.m (x_free_frame_resources): New function.
15178         (x_destroy_window): Move code to x_free_frame_resources.
15180         * xfns.c (unwind_create_frame): Fix comment.
15181         (Fx_create_frame, x_create_tip_frame):
15182         Move terminal->reference_count++ just before making the frame
15183         official.  Move initialization of image_cache_refcount and
15184         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15186 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
15188         Support MSVC build with newer versions of Visual Studio.
15189         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15190         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
15191         nt/gmake.defs.
15193         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15194         which are not supported by MSVC.
15195         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15196         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15197         bitfields.
15198         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15199         types in bitfields.
15200         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15202         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15204 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
15206         Support MSVC build with newer versions of Visual Studio.
15207         * w32.c: Don't include w32api.h for MSVC.
15208         (init_environment) [_MSC_VER]: Call sys_access, not _access.
15210         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15211         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15212         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15213         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15214         e_* cousins.
15215         (alloca) [_MSC_VER]: Define to _alloca.
15217         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15219         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15221 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
15223         * xdisp.c (note_mouse_highlight): If either of
15224         previous/next-single-property-change returns nil, treat that as
15225         the beginning or the end of the buffer.  (Bug#9955)
15227 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
15229         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
15230         label is not null (Bug#9951).
15231         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15232         may be NULL.
15234 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
15236         * window.c (Fwindow_body_size): Mention in the doc string that the
15237         return value is in frame's canonical units.  (Bug#9949)
15239 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
15241         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
15243         * w32fns.c (unwind_create_frame): If needed, free the glyph
15244         matrices of the partially constructed frame.  (Bug#9943)
15245         * xfns.c (unwind_create_frame): Likewise.
15247 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
15249         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15250         Don't stop backward scan on the continuation glyph, even though
15251         its CHARPOS is positive.
15252         (mouse_face_from_buffer_pos, note_mouse_highlight):
15253         Rename cover_string to disp_string.
15255 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
15257         * window.c (temp_output_buffer_show): Don't use
15258         Vtemp_buffer_show_specifiers.
15259         (Vtemp_buffer_show_specifiers): Remove unused variable.
15261 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
15263         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15264         past the beginning of the current glyph matrix.
15266 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
15268         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15269         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15270         HAVE_GTK3 (Bug#9869).
15272         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15273         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15275         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15277         * xterm.c: Declare x_handle_net_wm_state to return int.
15278         (handle_one_xevent): Check if we are iconified but don't have
15279         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
15280         (get_current_wm_state): Return non-zero if not hidden,
15281         check for _NET_WM_STATE_HIDDEN (Bug#9893).
15282         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15283         (x_handle_net_wm_state): Return what get_current_wm_state returns.
15284         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15286 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
15288         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15289         so that this new function doesn't get optimized away by a
15290         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
15292 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
15294         * frame.h (MOUSE_HL_INFO): Remove excess parens.
15296 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
15298         Fix the `xbytecode' command.
15299         * .gdbinit (xprintbytestr): New command.
15300         (xwhichsymbols): Rename from `which'; all callers changed.
15301         (xbytecode): Print the byte-code string as well.
15303 2011-10-29  Kim Storm  <storm@cua.dk>
15305         * alloc.c (which_symbols): New function.
15307 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
15309         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15310         line.  (Bug#9903)
15312 2011-10-29  Glenn Morris  <rgm@gnu.org>
15314         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15315         Not clear what it was for, and it causes various bugs.  (Bug#9839)
15317 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
15319         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15320         possible random value that matches one of those tested as
15321         condition to clear the mouse face.
15323 2011-10-28  Chong Yidong  <cyd@gnu.org>
15325         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15327 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
15329         * window.c (make_window): Initialize phys_cursor_on_p.
15331 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
15333         * lisp.h (struct Lisp_Symbol): Update comments.
15335 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
15337         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15339 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
15341         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
15342         <oslsachem@gmail.com> for helping to debug this.
15344         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15345         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15346         (g_b_init_get_glyph_outline_w): New static variables.
15347         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15348         (GetGlyphOutlineW_Proc): New typedefs.
15349         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
15350         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15351         New functions.
15352         (w32font_open_internal, compute_metrics):
15353         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
15354         instead of calling the "wide" APIs directly.
15356         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15358         * w32.h (syms_of_w32font): Add prototype.
15360 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
15362         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15363         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15364         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15365         (Fmove_to_window_line): Doc fix.
15367 2011-10-27  Chong Yidong  <cyd@gnu.org>
15369         * process.c (make_process): Set gnutls_state to NULL.
15371         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15372         non-NULL, regardless of GNUTLS_INITSTAGE.
15373         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
15374         an error.  Set process slots as soon as we allocate them.
15376         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15378 2011-10-27  Chong Yidong  <cyd@gnu.org>
15380         * gnutls.c (emacs_gnutls_deinit): New function.
15381         Deallocate credentials structures as well as calling gnutls_deinit.
15382         (Fgnutls_deinit, Fgnutls_boot): Use it.
15384         * process.c (make_process): Initialize GnuTLS credentials to NULL.
15385         (deactivate_process): Call emacs_gnutls_deinit.
15387 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
15389         * image.c (x_create_x_image_and_pixmap):
15390         * w32.c (sys_rename, w32_delayed_load):
15391         * w32font.c (fill_in_logfont):
15392         * w32reg.c (x_get_string_resource): Silence compiler warnings.
15394 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
15396         * w32fns.c (w32_default_color_map): New function,
15397         extracted from Fw32_default_color_map.
15398         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
15400 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
15402         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15404 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
15406         * keyboard.c (test_undefined): New function (bug#9751).
15407         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15409 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
15411         * sysdep.c (init_sys_modes): Fix the check for the controlling
15412         terminal (Bug#6649).
15414 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
15416         * dispextern.h (struct bidi_it): New member next_en_type.
15418         * bidi.c (bidi_line_init): Initialize the next_en_type member.
15419         (bidi_resolve_explicit_1): When next_en_pos is valid for the
15420         current character, check also for next_en_type being WEAK_EN.
15421         (bidi_resolve_weak): Don't enter the expensive loop if the current
15422         position is before next_en_pos.  Record the bidi type of the first
15423         non-ET, non-BN character we find, in addition to its position.
15424         (bidi_level_of_next_char): Invalidate next_en_type when
15425         next_en_pos is over-stepped.
15427 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
15429         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15430         * editfns.c: Rewrite current-time-zone so that it invokes
15431         the equivalent of (format-time-string "%Z") to get the time zone name.
15432         This fixes a bug when the time zone name contains characters that
15433         need converting from the system time locale to Emacs internal format.
15434         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15435         that patch fixed format-time-string to do the conversion, but
15436         I forgot to fix current-time-zone.
15437         (format_time_string): New function, containing most of
15438         what Fformat_time_string used to contain.
15439         (Fformat_time_string): Rewrite in terms of format_time_string.
15440         This doesn't change this function's behavior.
15441         (current-time-zone): Rewrite to use format_time_string.
15442         This fixes the bug reported by Michael Schierl in
15443         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15444         Jason Rumney's 2007-06-07 change worked around this bug, but
15445         didn't fix it.
15446         * systime.h (tzname, timezone): Remove no-longer-used declarations.
15448 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
15450         * xdisp.c (start_display): If the character at POS is displayed
15451         via a display vector, reset IT->current.dpvec_index to zero.
15452         (try_window_reusing_current_matrix): If a line ends in a display
15453         vector or the next line starts in a display vector, continue
15454         redrawing the window even though the character position of
15455         start_row was reached.
15456         (Bug#9771, part 2)
15458 2011-10-18  Chong Yidong  <cyd@gnu.org>
15460         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15461         with nobreak-char-display too.
15463 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
15465         Fix part 3 of bug#9771.
15466         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15467         (bidi_resolve_neutral): Don't enter the expensive loop looking for
15468         non-neutral characters if the current character is a paragraph
15469         separator (a.k.a. Newline).  This avoids running the same
15470         expensive loop twice, once when we consume the preceding newline
15471         and the other time when the line actually needs to be displayed.
15472         Avoid the loop when we see neutrals on the base embedding level
15473         following a character whose directionality is the same as the
15474         paragraph's.  This avoids running the expensive loop when a line
15475         ends in a long sequence of neutrals, like control characters.
15476         Add assertion against STRONG_AL type.  Slightly rearrange code
15477         that determines the type of a neutral given the first non-neutral
15478         that follows it.
15479         (bidi_level_of_next_char): Set next_en_pos to zero when
15480         invalidating its info.
15482 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
15484         * xdisp.c (push_display_prop): Determine whether to record string
15485         or buffer position by IT->string, not by IT->method.  Allow
15486         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
15487         (move_it_vertically_backward): Don't look for character position
15488         immediately after the newline when in a continuation line.
15489         (Bug#9771, part 1)
15491 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
15493         * window.c (coordinates_in_window): Rewrite and delabelize
15494         vertical border check.  (Bug#5357) (Bug#9618)
15496 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
15498         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15499         errors in XSetWindowBorder (bug#9310).
15501 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
15503         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15504         avoid crash when xmalloc overrun checking is enabled.
15506 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
15508         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15509         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
15510         cursor motion with <left> and <right> arrow keys.
15512         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15513         some callers set that themselves.
15515 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
15517         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15518         display string and the previous row comes from the same string and
15519         is empty.  (Bug#9739)  (Bug#9738)
15521 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
15523         * doc.c (get_doc_string): Encode file name (bug#9735).
15525 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
15527         * bidi.c (bidi_level_of_next_char):
15528         * xdisp.c (get_visually_first_element): Remove old incorrect
15529         comments regarding the Unicode Line Separator character.
15531         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15533 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
15535         * alloc.c (Fgc_status): Do not access beyond zombies array
15536         boundary if nzombies > MAX_ZOMBIES.
15537         * alloc.c (dump_zombies): Add missing format specifier.
15539 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
15541         * xdisp.c (set_cursor_from_row): Simplify conditionals,
15542         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15544         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15545         Some packages use them to denote characters with modifiers.
15547 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
15549         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15550         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15551         matching a pp-number.  Rename parameter var to var1.
15553 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
15555         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15557 2011-10-08  Glenn Morris  <rgm@gnu.org>
15559         * callint.c (Fcall_interactively): Give a more explicit error for the
15560         'c' case with a non-character input.  (Bug#8479)
15562 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
15564         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15565         lines.
15566         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15567         lines that are hscrolled on the left.
15569         * dispnew.c (buffer_posn_from_coords): Account for a possible
15570         presence of header-line.  (Bug#4426)
15572 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
15574         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15575         Don't advertise functionality which we discourage or doesn't work.
15577 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
15579         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15580         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
15581         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15582         this makes Emacs dump core during garbage collection on rare
15583         occasions.  sizeof is obviously inferior to offsetof here, so
15584         stick with offsetof.
15585         (GC_POINTER_ALIGNMENT): New macro.
15586         (mark_memory): Omit 3rd (offset) arg; caller changed.
15587         Don't assume EMACS_INT alignment is the same as pointer alignment.
15589 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
15591         * keyboard.c (read_key_sequence_remapped): New var.
15592         (read_key_sequence): Compute remapping in the right buffer.
15593         (command_loop_1): Use read_key_sequence's remapping directly.
15595 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
15597         * dired.c (file_name_completion): Don't expand file name.
15598         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15599         before checking file name handler.
15601         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15602         they've been requested explicitly (bug#9591).
15604 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
15606         * keymap.c (Fsingle_key_description): Use make_specified_string
15607         instead of build_string to build string from push_key_description.
15608         (Bug#5193)
15610 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
15612         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15613         This fixes a Y2038 bug on 64-bit hosts.
15614         * buffer.c (reset_buffer):
15615         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15616         (Fclear_buffer_auto_save_failure):
15617         Use 0, not -1, to represent an unset failure time, since time_t
15618         might not be signed.
15620         Remove dependency on glibc malloc internals.
15621         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15622         Move back here from lisp.h, but with their new implementations.
15623         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15624         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15625         * charset.c (charset_table_init): New static var.
15626         (syms_of_charset): Use it instead of xmalloc.  This removes a
15627         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
15628         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15629         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15630         Move back to alloc.c.
15631         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15632         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15634 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
15636         * nsterm.m (windowDidResize): Call x_set_window_size only when
15637         ns_in_resize is true.  Otherwise set pixelwidth/height and
15638         call change_frame_size (Bug#9628).
15640 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
15642         Port --enable-checking=all to Fedora 14 x86-64.
15643         * charset.c (syms_of_charset): Also account for glibc malloc's
15644         internal overhead when calculating the initial malloc maximum.
15646         Port --enable-checking=all to Fedora 14 x86.
15647         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15648         Move to lisp.h.
15649         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15650         (overrun_check_realloc, overrun_check_free):
15651         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15652         That way, xmalloc returns a properly-aligned pointer even if
15653         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
15654         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15655         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15656         into account when calculating the initial malloc maximum.
15657         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15658         Move here from alloc.c, so that charset.c can use it too.
15659         Properly align; the old code wasn't right for common 32-bit hosts
15660         when configured with --enable-checking=all.
15661         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15662         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15664 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
15666         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
15667         use EDOM.
15669 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
15671         * xdisp.c (compute_display_string_end): If there's no display
15672         string at CHARPOS, return -1.
15674         * bidi.c (bidi_fetch_char): When compute_display_string_end
15675         returns a negative value, treat the character as a normal
15676         character not covered by a display string.  (Bug#9624)
15678 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
15680         * lread.c (Fread_from_string): Fix typo in docstring.
15682 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
15684         * xdisp.c (handle_invisible_prop): If invisible text ends on a
15685         newline, reseat the iterator instead of bidi-iterating there one
15686         character at a time.  (Bug#9610)
15687         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15688         TO_CHARPOS if the bidi iterator is at base embedding level.
15690 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
15692         * lread.c (readevalloop): Use correct code for NBSP.
15693         (read1): Likewise.  (Bug#9608)
15695 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
15697         * dbusbind.c (Fdbus_register_signal): When service is not
15698         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
15700 2011-09-25  Glenn Morris  <rgm@gnu.org>
15702         * buffer.c (truncate-lines): Doc fix.
15704 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
15706         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15707         (Fset_window_next_buffers): Doc fix.
15709 2011-09-24  Glenn Morris  <rgm@gnu.org>
15711         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
15713 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
15715         Fix minor problems found by static checking.
15716         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
15717         * indent.c (Fvertical_motion): Fix == vs = typo.
15719 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
15721         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15722         Default value is now t.  Doc fix.
15724         * indent.c (Fvertical_motion): Compute and apply the overshoot
15725         logic when moving up, not only when moving down.  Fix the
15726         confusing name and values of the it_overshoot_expected variable;
15727         logic changes accordingly.  (Bug#9254) (Bug#9549)
15729         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15730         CHARPOS is covered by a display string which includes newlines.
15731         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15732         is covered by a display string with embedded newlines.
15734 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
15736         * dbusbind.c (Fdbus_register_signal): Add match rule to
15737         Vdbus_registered_objects_table.  (Bug#9581)
15738         (Fdbus_register_method, Vdbus_registered_objects_table):
15739         Fix docstring.
15741 2011-09-24  Jim Meyering  <meyering@redhat.com>
15743         do not ignore write error for any output size
15744         The previous change was incomplete.
15745         While it makes emacs --batch detect the vast majority of stdout
15746         write failures, errors were still ignored whenever the output size is
15747         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
15748           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15749               && echo FAIL: ignored write error
15750           FAIL: ignored write error
15751           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15752               && echo FAIL: ignored write error
15753           FAIL: ignored write error
15754         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
15756 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
15758         * emacs.c (Fkill_emacs): In noninteractive mode exit
15759         non-successfully if a write error occurred on stdout.  (Bug#9574)
15761 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
15763         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15764         the xassert test.
15766         * dispextern.h (struct it): Update the comment documenting what
15767         can it->OBJECT be.
15769 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
15771         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15772         a display string, extend search for cursor position to end of row.
15773         (find_row_edges): If the row ends in a newline from a display
15774         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
15775         Handle the case of a display string with multiple newlines.
15776         (Fcurrent_bidi_paragraph_direction): Fix search for previous
15777         non-empty line.  Fixes confusing cursor motion with arrow keys at
15778         the beginning of a line that starts with whitespace.
15780 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15782         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15783         (bug#9493).
15785 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
15787         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15788         boolean (Bug#9154).
15790 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
15792         * xdisp.c (display_line): Record maximum and minimum buffer
15793         positions even if no glyphs were produced (e.g., by a zero-width
15794         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
15795         buffer positions that will be removed from the glyph row because
15796         they don't fit.
15797         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15798         column is beyond frame width: don't subtract 1 "pixel" when
15799         computing width of the stretch.
15800         (reseat_at_next_visible_line_start): Undo the change made on
15801         2011-09-17 that saved paragraph information and restored it after
15802         the call to `reseat'.  (Bug#9545)
15804 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15806         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15807         and turn window cursor on if cleared (Bug#9415).
15809 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
15811         * search.c (boyer_moore): Take unibyte characters from pattern
15812         literally.  (Bug#9458)
15814 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
15816         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15818 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
15820         Fix minor problem found by static checking.
15821         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15822         initialized, to pacify gcc -Wuninitialized.
15824         * fileio.c: Report proper errno when syscall falls.
15825         (Finsert_file_contents): Save and restore errno,
15826         so that report_file_error outputs the correct diagnostic.
15827         (Fwrite_region) [CLASH_DETECTION]: Likewise.
15829 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
15831         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15833 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
15835         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15836         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9530)
15838 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
15840         * xdisp.c (reseat_at_next_visible_line_start): Keep information
15841         about the current paragraph and restore it after the call to reseat.
15843         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15844         (bidi_find_paragraph_start): Search back for paragraph beginning
15845         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15846         (bidi_move_to_visually_next): Only trigger paragraph-related
15847         computations when the last character is a newline or at EOB, not
15848         just any NEUTRAL_B.  (Bug#9470)
15850         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15851         truncated lines if point is covered by a display string.  (Bug#9524)
15853 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
15855         * xselect.c: Relax test for outgoing X longs (Bug#9498).
15856         (cons_to_x_long): New function.
15857         (lisp_data_to_selection_data): Use it.  Correct the test for
15858         short-versus-long data; it was negated.  Break out of vector
15859         loop, for efficiency, when a long datum is discovered.
15861 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
15863         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15865 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
15867         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15868         GCC PR/17406) by declaring this function with external scope.
15870 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
15872         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15873         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15875 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
15877         * editfns.c (Fformat): Correctly handle text properties on "%%".
15879 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
15881         * xterm.c (x_draw_composite_glyph_string_foreground):
15882         * w32term.c (x_draw_composite_glyph_string_foreground):
15883         * term.c (encode_terminal_code):
15884         * composite.c (composition_update_it, get_composition_id):
15885         * xdisp.c (get_next_display_element)
15886         (fill_composite_glyph_string): Add comments about special meaning
15887         of TAB characters in a composition.
15889 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
15891         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
15892         This occurs when processing a multibyte format.
15893         Problem reported by Wolfgang Jenker.
15895 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
15897         * xdisp.c (try_cursor_movement): Only check for exact match if
15898         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
15900 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
15902         Remove unused external symbols.
15903         * dispextern.h (calc_pixel_width_or_height): Remove decl.
15904         * xdisp.c (calc_pixel_width_or_height): Now static.
15905         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15906         * indent.c (check_display_width):
15907         * w32term.c: Fix comment to match code.
15908         * xterm.c, xterm.h (x_catching_errors): Remove.
15910 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
15912         * xselect.c: Use signed conversions more consistently (Bug#9498).
15913         (selection_data_to_lisp_data): Assume incoming selection data are
15914         signed integers, not unsigned.  This is to be consistent with
15915         outgoing selection data, which was modified to use signed integers
15916         in as part of the fix to Bug#9196 in response to Jan D.'s comment
15917         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15918         expects long, not unsigned long.
15920 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
15922         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15923         computation of loop end.  Reported by Johan Bockgård
15924         <bojohan@gnu.org>.
15926 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
15928         * frame.c (Fother_visible_frames_p): Function deleted.
15930 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
15932         * indent.c (compute_motion): Process display vector front to back
15933         rather than the other way around.  (Bug#2496)
15935 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
15937         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15939 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
15941         * minibuf.c (Fread_from_minibuffer): Doc fix.
15943 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
15945         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15946         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9475)
15948 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15950         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15951         value for non-existent files.
15953 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
15955         * fileio.c (Finsert_file_contents): If the file cannot be opened,
15956         set its "size" to -1.  This will set the modtime_size field of
15957         the corresponding buffer to -1, which is what
15958         verify-visited-file-modtime expects for files that do not exist.
15959         (Bug#9139)
15961 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
15963         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15964         here ...
15965         * lisp.h: ... from here.  push_key_description is no longer
15966         defined in keyboard.c, so its declaration should not be in
15967         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15968         logically belongs with push_key_description.
15970 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
15972         * buffer.h: Include <sys/types.h> instead of <time.h>.
15973         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15974         Problem reported by Herbert J. Skuhra.
15976 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15978         * xml.c (parse_region): Make the parsing work for
15979         non-comment-starting XML files again (bug#9144).
15981 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
15983         * image.c (gif_load): Fix calculation of bottom and right corner.
15984         (Bug#9468)
15986 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
15988         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
15989         redisplay in small windows.
15991 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
15993         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15995 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
15997         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15998         Operate on live windows only.
16000 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
16002         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16004 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
16006         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16007         only under bidi iteration.
16009 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
16011         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16013 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
16015         isnan: Fix porting problem to Solaris 10 with bundled gcc.
16016         Without this fix, the command to link temacs failed due to an
16017         undefined symbol __builtin_isnan.  This is because
16018         /usr/include/iso/math_c99.h #defines isnan(x) to
16019         __builtin_isnan(x), but the bundled gcc, which identifies itself
16020         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16021         a __builtin_isnan.
16022         * floatfns.c (isnan): #undef, and then #define to a clone of
16023         what's in data.c.
16024         (Fisnan): Always define, since it's always available now.
16025         (syms_of_floatfns): Always define isnan at the Lisp level.
16027 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
16029         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16031 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
16033         * fileio.c: Fix bugs with large file offsets (Bug#9428).
16034         The previous code assumed that file offsets (off_t values) fit in
16035         EMACS_INT variables, which is not true on typical 32-bit hosts.
16036         The code messed up by falsely reporting buffer overflow in cases
16037         such as (insert-file-contents "big" nil 1 2) into an empty buffer
16038         when "big" contains more than 2**29 bytes, even though this
16039         inserts just one byte and does not overflow the buffer.
16040         (Finsert_file_contents): Store file offsets as off_t
16041         values, not as EMACS_INT values.  Check for overflow when
16042         converting between EMACS_INT and off_t.  When checking for
16043         buffer overflow or for overlap, take the offsets into account.
16044         Don't use EMACS_INT for small values where int suffices.
16045         When checking for overlap, fix a typo: ZV was used where
16046         ZV_BYTE was intended.
16047         (Fwrite_region): Don't assume off_t fits into 'long'.
16048         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16050 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
16052         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16054 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
16056         sprintf-related integer and memory overflow issues (Bug#9412).
16058         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
16059         (esprintf, exprintf, evxprintf): New functions.
16060         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
16061         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
16062         (modify_event_symbol): Do not assume that the length of
16063         name_alist_or_stem is safe to alloca and fits in int.
16064         (Fexecute_extended_command): Likewise for function name and binding.
16065         (Frecursion_depth): Wrap around reliably on integer overflow.
16066         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16067         since some callers pass EMACS_INT values.
16068         (Fsingle_key_description): Don't crash if symbol name contains more
16069         than MAX_ALLOCA bytes.
16070         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16071         (get_minibuffer): Arg is now EMACS_INT, not int.
16072         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
16073         (esprintf, exprintf, evxprintf): New decls.
16074         * window.h (command_loop_level, minibuf_level): Reflect API changes.
16076         * dbusbind.c (signature_cat): New function.
16077         (xd_signature, Fdbus_register_signal):
16078         Do not overrun buffer; instead, report string overflow.
16080         * dispnew.c (add_window_display_history): Don't overrun buffer.
16081         Truncate instead; this is OK since it's just a log.
16083         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16084         even if the time zone offset is outlandishly large.
16085         Don't mishandle offset == INT_MIN.
16087         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16088         when creating daemon; the previous buffer-overflow check was incorrect.
16090         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16091         which has the guts of the old verror function.
16093         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16094         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
16096         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16097         (font_unparse_xlfd): Don't blindly alloca long strings.
16098         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
16099         fits in int, when using sprintf.  Use single snprintf to count
16100         length of string rather than counting it via multiple sprintfs;
16101         that's simpler and more reliable.
16102         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16103         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16104         sprintf, in case result does not fit in int.
16106         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16107         (fontset_from_font): Print it.
16109         * frame.c (tty_frame_count): Now printmax_t, not int.
16110         (make_terminal_frame, set_term_frame_name): Print it.
16111         (x_report_frame_params): In X, window IDs are unsigned long,
16112         not signed long, so print them as unsigned.
16113         (validate_x_resource_name): Check for implausibly long names,
16114         and don't assume name length fits in 'int'.
16115         (x_get_resource_string): Don't blindly alloca invocation name;
16116         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
16117         not fit in int.
16119         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16120         (xg_check_special_colors, xg_set_geometry):
16121         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16123         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16124         Use esprintf, not sprintf, in case result does not fit in int.
16126         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16127         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16128         it as a large positive number.
16129         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16130         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16132         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16133         in case result does not fit in int.
16135         * print.c (float_to_string): Detect width overflow more reliably.
16136         (print_object): Make sprintf buffer a bit bigger, to avoid potential
16137         buffer overrun.  Don't assume list length fits in 'int'.  Treat
16138         print length of 0 as 0, not as infinity; to be consistent with other
16139         uses of print length in this function.  Don't overflow print length
16140         index.  Don't assume hash table size fits in 'long', or that
16141         vectorlike size fits in 'unsigned long'.
16143         * process.c (make_process): Use printmax_t, not int, to format
16144         process-name gensyms.
16146         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16148         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16149         to avoid potential buffer overrun.
16151         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16152         if X resource line is longer than 512 bytes.
16154         * xfns.c (x_window): Make sprintf buffer a bit bigger
16155         to avoid potential buffer overrun.
16157         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16159         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16161 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
16163         Integer overflow fixes for scrolling, etc.
16164         Without these, Emacs silently mishandles large integers sometimes.
16165         For example, "C-u 4294967297 M-x recenter" was treated as if
16166         it were "C-u 1 M-x recenter" on a typical 64-bit host.
16168         * xdisp.c (try_window_id): Check Emacs fixnum range before
16169         converting to 'int'.
16171         * window.c (window_scroll_line_based, Frecenter):
16172         Check that an Emacs fixnum is in range before assigning it to 'int'.
16173         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16174         values converted from Emacs fixnums.
16175         (Frecenter): Don't wrap around a line count if it is out of 'int'
16176         range; instead, treat it as an extreme value.
16177         (Fset_window_configuration, compare_window_configurations):
16178         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16180         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16181         that can exceed INT_MAX.  Check that EMACS_INT value is in range
16182         before assigning it to the (possibly-narrower) index.
16183         (match_limit): Don't assume that a fixnum can fit in 'int'.
16185         * print.c (print_object): Use ptrdiff_t, not int, for index that can
16186         exceed INT_MAX.
16188         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
16189         (Fvertical_motion): Don't wrap around LINES values that don't fit
16190         in 'int'.  Instead, treat them as extreme values.  This is good
16191         enough for windows, which can't have more than INT_MAX lines anyway.
16193 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
16195         * Require libxml/parser.h to avoid compilation warning.
16197         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16199         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16200         since this reportedly can destroy thread storage.
16202 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
16204         * syntax.c (find_defun_start): Update all cache variables if
16205         exiting early (Bug#9401).
16207 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
16209         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16211         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16212         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
16213         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
16215         * term.c (tty_append_glyph): New function.
16216         (produce_stretch_glyph): Static function and its prototype deleted.
16218         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16219         Add prototypes.
16221 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
16223         * image.c (parse_image_spec): Check for nonnegative, not for positive,
16224         when checking :margin (Bug#9390).
16225         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
16226         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
16227         so that the name doesn't mislead.  All uses changed.
16229 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
16231         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16232         set_tty_hooks.
16234 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
16236         * xdisp.c (move_it_to): Don't bail out early when reaching
16237         position beyond to_charpos, if we are scanning backwards.
16238         (move_it_vertically_backward): When DY == 0, make sure we get to
16239         the first character in the line after the newline.
16241 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
16243         * ccl.c: Improve and simplify overflow checking (Bug#9196).
16244         (ccl_driver): Do not generate an out-of-range pointer.
16245         (Fccl_execute_on_string): Remove unnecessary check for
16246         integer overflow, noted by Stefan Monnier in
16247         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16248         Remove a FIXME that didn't need fixing.
16249         Simplify the newly-introduced buffer reallocation code.
16251 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
16253         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16255 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
16257         Integer and memory overflow issues (Bug#9196).
16259         * doc.c (get_doc_string): Rework so that
16260         get_doc_string_buffer_size is the actual buffer size, rather than
16261         being 1 less than the actual buffer size; this makes xpalloc more
16262         convenient.
16264         * image.c (x_allocate_bitmap_record, cache_image):
16265         * xselect.c (Fx_register_dnd_atom):
16266         Simplify previous changes by using xpalloc.
16268         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16269         since either will do and ptrdiff_t is convenient with xpalloc.
16271         * charset.c (charset_table_size)
16272         (struct charset_sort_data.priority): Now ptrdiff_t.
16273         (charset_compare): Don't overflow if priorities differ greatly.
16274         (Fsort_charsets): Don't assume list length fits in int.
16275         Check for size-calculation overflow when allocating sort data.
16276         (syms_of_charset): Allocate an initial charset table that is
16277         just under 64 KiB, to avoid problems with glibc malloc and mmap.
16279         * cmds.c (internal_self_insert): Check for size-calculation overflow.
16281         * composite.h (struct composition.glyph_len): Now int, not unsigned.
16282         The actual value is always <= INT_MAX, and leaving it unsigned made
16283         overflow checking harder.
16285         * dispextern.h (struct glyph_matrix.rows_allocated)
16286         (struct face_cache.size): Now ptrdiff_t, for convenience in use
16287         with xpalloc.  The values are still always <= INT_MAX.
16289         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16291         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16292         (SAFE_NALLOCA): New macro.
16294         * region-cache.c (struct boundary.pos, find_cache_boundary)
16295         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16296         (set_cache_region, invalidate_region_cache)
16297         (revalidate_region_cache, know_region_cache, region_cache_forward)
16298         (region_cache_backward, pp_cache):
16299         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
16300         so that ptrdiff_t * can be passed to xpalloc.
16301         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16302         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16303         (pp_cache): Don't assume cache_len fits in int.
16304         * region-cache.h: Adjust extern decls to match.
16306         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16307         EMACS_INT, since either will do, for xpalloc.
16309         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16310         (xnmalloc, xnrealloc, xpalloc): New functions.
16312         * bidi.c (bidi_shelve_header_size): New constant.
16313         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16314         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16316         * bidi.c (bidi_cache_shrink):
16317         * buffer.c (overlays_at, overlays_in, record_overlay_string)
16318         (overlay_strings):
16319         Don't update size of array until after memory allocation succeeds,
16320         because xmalloc/xrealloc may not return.
16321         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16322         now that we have proper integer overflow checking.
16323         (record_overlay_string, overlay_strings): Catch overflows when
16324         calculating size of overlay_str_buf.
16326         * callproc.c (Fcall_process): Check for size overflow when
16327         calculating size of args2.
16328         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16329         Normally we prefer signed values, but sticking with ptrdiff_t would
16330         require adding more-complicated checks.
16332         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16333         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16334         Redo buffer-overflow calculations to avoid integer overflow.
16335         Add a FIXME comment where memory seems to be over-allocated.
16337         * character.c (Fstring): Check for size-calculation overflow.
16339         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16340         unnecessary integer overflow.  Check for size overflow.
16341         (encode_coding_object): Don't update size until xmalloc succeeds.
16343         * composite.c (get_composition_id): Check for overflow in glyph
16344         length calculations.
16346         Integer and memory overflow fixes for display code.
16347         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16348         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16349         (scrolling_window): Check for overflow in size calculations.
16350         (line_draw_cost, realloc_glyph_pool, add_row_entry):
16351         Don't assume glyph table len fits in int.
16352         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16353         (row_table_size): Now ptrdiff_t, not int.
16354         (scrolling_window): Avoid overflow in size calculations.
16355         Don't update size until allocation succeeds.
16356         * fns.c (concat): Check for overflow in size calculations.
16357         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16358         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16359         (NEXT_ALMOST_PRIME_LIMIT): New constant.
16361         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16362         (get_doc_string): Check for size calculation overflow.
16363         Don't update size until allocation succeeds.
16364         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16365         EMACS_INT, where ptrdiff_t will do.
16366         (Fsubstitute_command_keys): Check for string overflow.
16368         * editfns.c (set_time_zone_rule): Don't assume environment length
16369         fits in int.
16370         (message_length): Now ptrdiff_t, not int.
16371         (Fmessage_box): Don't update size until allocation succeeds.
16372         Don't assume message length fits in int.
16373         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16375         * emacs.c (main): Do not reallocate argv, since there is a null at
16376         the end that can be overwritten, and this way there's no need to
16377         worry about size-calculation overflow.
16378         (sort_args): Check for size-calculation overflow.
16380         * eval.c (init_eval_once, grow_specpdl): Don't update size until
16381         alloc succeeds.
16382         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16384         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16385         (x_set_scroll_bar_width, x_figure_window_size):
16386         Check for integer overflow.
16387         (x_set_alpha): Do not assume XINT fits in int.
16389         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16390         This is for the members text_lines, text_cols, total_lines, total_cols,
16391         where the system imposes an 'int' limit.
16393         * fringe.c (Fdefine_fringe_bitmap):
16394         Don't update size until alloc works.
16396         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16397         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16399         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16400         Check for size-calculation overflow.
16401         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16402         do, as we prefer signed integers.
16403         (id_to_widget.max_size, id_to_widget.used)
16404         (xg_store_widget_in_map, xg_remove_widget_from_map)
16405         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16406         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16407         Use and return ptrdiff_t, not int.
16408         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16409         * gtkutil.h: Change prototypes to match the above.
16411         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16412         are duplicate now that they've been promoted to lisp.h.
16413         (x_allocate_bitmap_record, x_alloc_image_color)
16414         (make_image_cache, cache_image, xpm_load):
16415         Don't update size until alloc is done.
16416         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16417         (x_detect_edges):
16418         Check for size calculation overflow.
16419         (ct_colors_allocated_max): New constant.
16420         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16421         overflow.
16423         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16424         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16425         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16426         Use ptrdiff_t, not int, to count maps.
16427         (read_char_minibuf_menu_prompt): Check for overflow in size
16428         calculations.  Don't update size until allocation succeeds.
16429         Redo calculations to avoid overflow.
16430         * keyboard.h: Change prototypes to match the above.
16432         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16433         to count maps.
16434         (current_minor_maps): Check for size calculation overflow.
16435         * keymap.h: Change prototypes to match the above.
16437         * lread.c (read1, init_obarray): Don't update size until alloc done.
16439         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16440         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16442         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16443         Now ptrdiff_t, not int.
16444         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16445         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16447         * process.c (Fnetwork_interface_list): Check for overflow
16448         in size calculation.
16450         * region-cache.c (move_cache_gap): Check for size calculation overflow.
16452         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16453         overflow.  Don't bother calling xmalloc when xrealloc will do.
16455         * search.c (Freplace_match): Check for size calculation overflow.
16456         (Fset_match_data): Don't assume list lengths fit in 'int'.
16458         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16459         for command line length.  Do not attempt to address one before the
16460         beginning of an array, as that's not portable.
16462         * term.c (max_frame_lines): Remove; unused.
16463         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16464         not int.
16465         (encode_terminal_code, calculate_costs): Check for size
16466         calculation overflow.
16467         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16468         table lengths and related sizes.  Don't update size until alloc
16469         done.  Redo calculations to avoid overflow.
16470         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16472         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16473         subtracting pointers.
16474         (gobble_line): Check for overflow more carefully.  Don't update size
16475         until alloc done.
16477         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16478         Don't update size until alloc done.
16479         Redo size calculations to avoid overflow.
16480         Check for size calculation overflow.
16481         (main) [DEBUG]: Fix typo in invoking tparam1.
16483         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16484         Use ptrdiff_t, not int, for sizes.
16485         (store_mode_line_noprop_char): Don't update size until alloc done.
16487         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16488         Use ptrdiff_t, not int, for sizes.
16489         (Finternal_make_lisp_face, cache_face):
16490         Check for size calculation overflow.
16491         (cache_face): Treat size calculation overflows as if they were
16492         memory exhaustion (the usual treatment), rather than aborting.
16494         * xfns.c (x_encode_text, x_set_name_internal)
16495         (Fx_change_window_property): Use ptrdiff_t, not int, to count
16496         sizes, since they can exceed INT_MAX in size.  Check for size
16497         calculation overflow.
16499         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16500         (xg_select): Check for size calculation overflow.
16501         Don't update size until alloc done.
16503         * xrdb.c (get_environ_db): Don't assume path length fits in int,
16504         as sprintf is limited to int lengths.
16506         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16507         (X_LONG_MIN): New macros.
16508         Use them to make the following changes clearer.
16509         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16510         This change doesn't affect the value now, but it may help remind
16511         future maintainers not to raise the value too much later.
16512         (SELECTION_QUANTUM): Remove, replacing with ...
16513         (selection_quantum): ... new function, which avoids overflow.
16514         All uses changed.
16515         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16516         assumption that selection length fits in 'int'.
16517         (x_reply_selection_request, x_handle_selection_request)
16518         (x_get_window_property, receive_incremental_selection)
16519         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16520         (lisp_data_to_selection_data, clean_local_selection_data):
16521         Use ptrdiff_t, not int, to record length of selection.
16522         (x_reply_selection_request, x_get_window_property)
16523         (receive_incremental_selection, x_property_data_to_lisp):
16524         Redo calculations to avoid overflow.
16525         (x_reply_selection_request): When sending hint, ceiling it at
16526         X_LONG_MAX rather than relying on wraparound overflow to send
16527         something.
16528         (x_get_window_property, receive_incremental_selection)
16529         (lisp_data_to_selection_data, x_property_data_to_lisp):
16530         Check for size-calculation overflow.
16531         (x_get_window_property, receive_incremental_selection)
16532         (lisp_data_to_selection_data, Fx_register_dnd_atom):
16533         Don't store size until memory allocation succeeds.
16534         (x_get_window_property): Plug memory leak on memory exhaustion.
16535         Don't double-block input; malloc is safe here.  Don't assume 2**34
16536         - 4 fits in unsigned long.  Add an xassert to check
16537         XGetWindowProperty overflow.  Be more careful about overflow
16538         calculations, and distinguish size from memory overflow better.
16539         (receive_incremental_selection): When tracing, don't assume
16540         unsigned int is less than INT_MAX.
16541         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16542         harmful) conversions of unsigned short to int.
16543         (lisp_data_to_selection_data): Don't assume that integers
16544         in the range -65535 through -1 fit in an X unsigned short.
16545         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
16546         result parameters unless successful.  Rely on cons_to_unsigned
16547         to report problems with elements; the old code wasn't right anyway.
16548         (x_check_property_data): Check for int overflow; we cannot use
16549         a wider type due to X limits.
16550         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16552         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
16554         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16555         (x_term_init): Check for size calculation overflow.
16556         (x_color_cells): Don't store size until memory allocation succeeds.
16557         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
16558         Don't assume alloca size is less than MAX_ALLOCA.
16559         (x_term_init): Don't assume length fits in int (sprintf is limited
16560         to int size).
16562         Use ptrdiff_t for composition IDs.
16563         * character.c (lisp_string_width):
16564         * composite.c (composition_table_size, n_compositions)
16565         (get_composition_id, composition_gstring_from_id):
16566         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16567         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16568         * window.c (Frecenter):
16569         Use ptrdiff_t, not int, for composition IDs.
16570         * composite.c (get_composition_id): Check for integer overflow.
16571         * composite.h: Adjust prototypes to match the above changes.
16573         Use ptrdiff_t for hash table indexes.
16574         * category.c (hash_get_category_set):
16575         * ccl.c (ccl_driver):
16576         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16577         * coding.c (coding_system_charset_list, detect_coding_system):
16578         * coding.h (struct coding_system.id):
16579         * composite.c (get_composition_id, gstring_lookup_cache):
16580         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16581         * image.c (xpm_get_color_table_h):
16582         * lisp.h (hash_lookup, hash_put):
16583         * minibuf.c (Ftest_completion):
16584         Use ptrdiff_t for hash table indexes, not int (which is too
16585         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16586         32-bit --with-wide-int hosts).
16588         * charset.c (Fdefine_charset_internal): Check for integer overflow.
16589         Add a FIXME comment about memory leaks.
16590         (syms_of_charset): Don't assume xmalloc returns.
16592         Don't assume that stated character widths fit in int.
16593         * character.c (Fchar_width, c_string_width, lisp_string_width):
16594         * character.h (CHAR_WIDTH):
16595         * indent.c (MULTIBYTE_BYTES_WIDTH):
16596         Use sanitize_char_width to avoid undefined and/or bad behavior
16597         with outlandish widths.
16598         * character.h (sanitize_tab_width): Rename from sanitize_width,
16599         now that we have two such functions.  All uses changed.
16600         (sanitize_char_width): New inline function.
16602         Don't assume that tab-width fits in int.
16603         * character.h (sanitize_width): New inline function.
16604         (SANE_TAB_WIDTH): New macro.
16605         (ASCII_CHAR_WIDTH): Use it.
16606         * indent.c (sane_tab_width): Remove.  All uses replaced by
16607         SANE_TAB_WIDTH (current_buffer).
16608         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16610         * fileio.c: Integer overflow issues with file modes.
16611         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16613         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
16614         Remove unreachable code.
16615         (read_hex, load_charset_map_from_file): Check for integer overflow.
16617         * xterm.c: Don't go over XClientMessageEvent limit.
16618         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16619         (x_send_scroll_bar_event): Likewise.  Check that the size does not
16620         exceed limits imposed by XClientMessageEvent, as well as the usual
16621         ptrdiff_t and size_t limits.
16623         * keyboard.c: Overflow, signedness and related fixes.
16624         (make_lispy_movement): Use same integer type in forward decl
16625         that is used in the definition.
16626         (read_key_sequence, keyremap_step):
16627         Change bufsize argument back to int, undoing my 2011-03-30 change.
16628         We prefer signed types, and int is wide enough here.
16629         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16630         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
16631         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
16632         length, not size_t.  Use ptrdiff_t for index, not int.
16633         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16634         possibility of integer overflow.
16636         Overflow, signedness and related fixes for images.
16638         * dispextern.h (struct it.stack[0].u.image.image_id)
16639         (struct_it.image_id, struct image.id, struct image_cache.size)
16640         (struct image_cache.used, struct image_cache.ref_count):
16641         * gtkutil.c (update_frame_tool_bar):
16642         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16643         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16644         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16645         * nsmenu.m (update_frame_tool_bar):
16646         * xdisp.c (calc_pixel_width_or_height):
16647         * xfns.c (image_cache_refcount):
16648         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16649         on typical 64-bit hosts.
16651         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16652         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16653         Omit unnecessary casts to int.
16654         (parse_image_spec): Check that integers fall into 'int' range
16655         when the callers expect that.
16656         (image_ascent): Redo ascent calculation to avoid int overflow.
16657         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16658         (lookup_image): Remove unnecessary tests.
16659         (xbm_image_p): Locals are now of int, not EMACS_INT,
16660         since parse_image_check makes sure they fit into int.
16661         (png_load, gif_load, svg_load_image):
16662         Prefer int to unsigned where either will do.
16663         (tiff_handler): New function, combining the cores of the
16664         old tiff_error_handler and tiff_warning_handler.
16665         This function is rewritten to use vsnprintf and thereby avoid
16666         stack buffer overflows.  It uses only the features of vsnprintf
16667         that are common to both POSIX and native Microsoft.
16668         (tiff_error_handler, tiff_warning_handler): Use it.
16669         (tiff_load, gif_load, imagemagick_load_image):
16670         Don't assume :index value fits in 'int'.
16671         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16672         (imagemagick_load_image): Check that crop parameters fit into
16673         the integer types that MagickCropImage accepts.  Don't assume
16674         Vimagemagick_render_type has a nonnegative value.  Don't assume
16675         size_t fits in 'long'.
16676         (gs_load): Use printmax_t to print the widest integers possible.
16677         Check for integer overflow when computing image height and width.
16679 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
16681         * xdisp.c (redisplay_window): Don't force window start if point
16682         will be invisible in the resulting window.  (Bug#9324)
16684 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
16686         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16687         the display spec is of the form `(space ...)'.
16688         (handle_display_spec): Return the value returned by
16689         handle_single_display_spec, not just 1 or zero.
16690         (handle_single_display_spec): If the display spec is of the form
16691         `(space ...)', and specifies display in the text area, return 2
16692         rather than 1.
16693         (try_cursor_movement): Check for the need to scroll more
16694         accurately, and prefer exact match for point under bidi.
16695         Don't advance `row' beyond the last row of the window.
16697         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16698         into disp_prop; all users changed.
16700         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16701         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16702         for the text covered by the display property.
16704 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
16706         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16707         Change return value to nil.
16708         (Frecord_buffer): Delete unused function.
16710 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
16712         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16713         buffers, return left-to-right.
16714         (set_cursor_from_row): Consider candidate row a win if its glyph
16715         represents a newline and point is on that newline.  Fixes cursor
16716         positioning on the newline at EOL of R2L text within L2R
16717         paragraph, and vice versa.
16718         (try_cursor_movement): Check continued rows, in addition to
16719         continuation rows.  Fixes unwarranted scroll when point enters a
16720         continued line of R2L text within an L2R paragraph, or vice versa.
16721         (cursor_row_p): Consider the case of point being equal to
16722         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
16723         from the end of a short line to the beginning of a continued line
16724         of R2L text within L2R paragraph.
16725         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16726         composed characters.
16728         * bidi.c (bidi_check_type): Use xassert.
16729         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16730         members.
16732 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
16734         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16735         a character.
16737 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
16739         * nsfont.m (ns_otf_to_script): Fix typo.
16741 2011-08-22  Kenichi Handa  <handa@m17n.org>
16743         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16744         extra slot even if the purpose is char-code-property-table.
16746 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
16748         * xdisp.c (redisplay_window): When computing centering_position,
16749         account for the height of the header line.  (Bug#8874)
16751         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16752         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
16753         candidate is selected by the mouse, and that candidate has a
16754         composed character under the mouse.
16756         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
16757         coordinates reported by pos-visible-in-window-p for a composed
16758         character in column zero.
16760 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
16762         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16764 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
16766         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16767         consider it a hit if to_charpos is anywhere in the range of the
16768         composed buffer positions.
16770 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
16772         * image.c (gif_load): Don't assume that each subimage has the same
16773         dimensions as the base image.  Handle disposal method that is
16774         "undefined" by the gif spec (Bug#9335).
16776 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
16778         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
16779         (Fcondition_case): Document `debug' symbol in error handler.
16781 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
16783         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16784         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16785         from an Org mode buffer to a Speedbar frame.
16787         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16788         a composition, take its buffer position from IT->cmp_it.charpos.
16789         Fixes cursor positioning at the beginning of a line that begins
16790         with a composed character.
16792 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
16794         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16795         character bidirectional type, use STRONG_L instead.  Fixes crashes
16796         in a buffer produced by `describe-categories'.
16798         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16799         members before the level stack, so they would be saved and
16800         restored when copying iterator state.  Fixes incorrect reordering
16801         around TABs covered by display properties.
16803 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
16805         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
16807 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
16809         * eval.c (internal_condition_case, internal_condition_case_1)
16810         (internal_condition_case_2, internal_condition_case_n):
16811         Remove unnecessary aborts (Bug#9081).
16813 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
16815         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16816         has no `load' handler, try opening the file locally.  (Bug#9311)
16818 2011-08-16  Ken Brown  <kbrown@cornell.edu>
16820         * gmalloc.c: Expand comment.
16822 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
16824         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16825         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
16827 2011-08-16  Ken Brown  <kbrown@cornell.edu>
16829         Fix memory allocation problems in Cygwin build (Bug#9273).
16831         * unexcw.c ( __malloc_initialized): Declare external variable.
16832         (fixup_executable): Force the dumped emacs to reinitialize malloc.
16834         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16835         New variables.
16836         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16837         dumped emacs.
16838         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16839         in the static heap.
16840         [CYGWIN] (special_realloc): New function.
16841         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16842         requests to realloc storage in the static heap.
16844 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
16846         * bidi.c (bidi_initialize): Remove unused local.
16848 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
16850         * bidimirror.h:
16851         * biditype.h: Remove file.
16852         * makefile.w32-in ($(BLD)/bidi.$(O)):
16853         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
16855         * dispextern.h: Fix a typo in the comment to bidi_type_t.
16857         * chartab.c: Improve commentary for the uniprop_table API.
16859         * bidi.c (bidi_paragraph_init): Support zero value of
16860         bidi_ignore_explicit_marks_for_paragraph_level.
16861         (bidi_initialize): Use uniprop_table instead of including
16862         biditype.h and bidimirror.h.
16864         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16865         coordinates of the iterator when restoring from ppos_it.
16866         (Bug#9296)
16868 2011-08-14  Kenichi Handa  <handa@m17n.org>
16870         * process.c (create_process): Call setup_process_coding_systems
16871         after the pid of the process is set to -1 (Bug#8162).
16873 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
16875         * xdisp.c (move_it_in_display_line_to): Don't invoke
16876         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16877         ppos_it.  Fixes vertical cursor motion when line beginning is
16878         covered by an image.  (Bug#9296)
16880 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
16882         * nsterm.h (ns_run_ascript): Declare.
16883         (NSAPP_DATA2_RUNASSCRIPT): Define.
16885         * nsfns.m (as_script, as_result, as_status): New static variables.
16886         (ns_run_ascript): New function.
16887         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
16888         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16889         the event loop.  Get status from as_status (Bug#7276).
16891         * nsterm.m (sendEvent): If event is NSApplicationDefined and
16892         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16893         the event loop (Bug#7276).
16895 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
16897         * gnutls.c (QCgnutls_bootprop_priority)
16898         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16899         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16900         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16901         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16902         (QCgnutls_bootprop_verify_hostname_error)
16903         (QCgnutls_bootprop_callbacks_verify): Rename from
16904         Qgnutls_bootprop_..., all uses changed.
16906         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16907         uses changed.
16909 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
16911         * xfaces.c (Qframe_set_background_mode): Now static.
16912         * dispextern.h (Qframe_set_background_mode): Remove decl.
16914         * process.c (Fnetwork_interface_info): Declare local only if needed.
16916 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
16918         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16919         (Fnetwork_interface_list): Allocate in increments of bytes instead
16920         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
16921         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
16922         sockaddr.
16923         (struct ifflag_def): notrailers is smart on OSX.
16924         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16925         Get hardware address with getifaddrs if available.
16927 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
16929         * xdisp.c (iterate_out_of_display_property): xassert that
16930         IT->position is set to within IT->object's boundaries.  Break from
16931         the loop as soon as EOB is reached; avoids infloops in redisplay
16932         when IT->position is set up wrongly due to some bug.
16933         Set IT->current to match the bidi iterator unconditionally.
16934         (push_display_prop): Allow GET_FROM_STRING as IT->method on
16935         entry.  Force push_it to save on the stack the current
16936         buffer/string position, to be restored by pop_it.  Fix flags in
16937         the iterator structure wrt the object coming from a display
16938         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16939         properties.  (Bug#9284)
16941 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
16943         * fontset.c (fontset_get_font_group): Add proper type checks.
16944         (Bug#9172)
16946 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
16948         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16949         and LC_VERSION_MIN_MACOSX.
16950         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16951         (dump_it) [LC_FUNCTION_STARTS]: Use it.
16953 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
16955         * xdisp.c (forward_to_next_line_start): Allow to use the
16956         no-display-properties-and-no-overlays under bidi display.
16957         Set disp_pos in the bidi iterator to avoid searches for display
16958         properties and overlays.
16960 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
16962         * editfns.c (Fset_time_zone_rule): Document relationship with the
16963         setenv function.
16965         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16966         the font entity extracted from the cache (Bug#8109).
16968 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
16970         * composite.c (autocmp_chars): Don't reset point.  That is done by
16971         restore_point_unwind (Bug#5984).
16973 2011-08-07  Juri Linkov  <juri@jurta.org>
16975         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16976         to show the arg `TIME' instead of `TIMEVAL'.
16978 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
16980         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16981         display property strides EOL and includes a newline, as in
16982         longlines-mode.  (Bug#9254)
16983         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16984         word-wrap under bidirectional display.  (Bug#9224)
16986         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16987         is non-zero, even if the data buffer is NULL.  Fixes a crash in
16988         vertical-motion with longlines-mode.  (Bug#9254)
16990 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
16992         * bidi.c <bidi_cache_total_alloc>: Now static.
16993         (bidi_initialize): Initialize bidi_cache_total_alloc.
16995         * xdisp.c (display_line): Release buffer allocated for shelved bidi
16996         cache.  (Bug#9221)
16998         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16999         amount allocated this far in `bidi_cache_total_alloc'.
17000         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17001         non-zero, only free the data buffer without restoring the cache
17002         contents.  All callers changed.
17004         * dispextern.h (bidi_unshelve_cache): Update prototype.
17006         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17007         (move_it_in_display_line, move_it_to)
17008         (move_it_vertically_backward, move_it_by_lines): Replace the call
17009         to xfree to an equivalent call to bidi_unshelve_cache.
17010         (move_it_in_display_line_to): Fix logic of returning
17011         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
17013 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
17015         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17016         came from a string character with a `cursor' property.  (Bug#9229)
17018 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
17020         * Makefile.in (LIB_PTHREAD): New variable.
17021         (LIBES): Add LIB_PTHREAD (Bug#9216).
17023         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17024         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17026 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
17028         * regex.c (re_iswctype): Remove some redundant boolean conversions.
17030 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
17032         * xterm.c (x_find_topmost_parent): New function.
17033         (x_set_frame_alpha): Find topmost parent window with
17034         x_find_topmost_parent and set the property there also (bug#9181).
17035         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17037 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
17039         * callproc.c (Fcall_process): Avoid vfork clobbering
17040         the local vars buffer, coding_systems, current_dir.
17042 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
17044         * keymap.c (Fmake_composed_keymap): Move to subr.el.
17046 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
17048         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17049         so that it is not optimized away.
17051         * xdisp.c (compute_display_string_pos): Remove unused local.
17053 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
17055         Fix slow cursor motion and scrolling in large buffers with
17056         selective display, like Org Mode buffers.  (Bug#9218)
17058         * dispextern.h (struct bidi_it): New member disp_prop_p.
17060         * xdisp.c: Remove one-slot cache of display string positions.
17061         (compute_display_string_pos): Accept an additional argument
17062         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
17063         for a display string or property.  If found, set DISP_PROP_P
17064         non-zero.
17066         * bidi.c (bidi_fetch_char): Accept an additional argument
17067         DISP_PROP_P, and pass it to compute_display_string_pos.
17068         Only handle text covered by a display string if DISP_PROP_P is returned
17069         non-zero.  All callers of bidi_fetch_char changed.
17071 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
17073         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17075 2010-12-03  Don March  <don@ohspite.net>
17077         * keymap.c (Fdefine_key): Fix non-prefix key error message when
17078         last character M-[char] is translated to ESC [char] (bug#7541).
17080 2011-08-02  Kenichi Handa  <handa@m17n.org>
17082         * lisp.h (uniprop_table): Extern it.
17084         * chartab.c (uniprop_table): Make it non-static.
17086 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
17088         * xdisp.c (forward_to_next_line_start): Accept additional argument
17089         BIDI_IT_PREV, and store into it the state of the bidi iterator had
17090         on the newline.
17091         (reseat_at_next_visible_line_start): Use the bidi iterator state
17092         returned by forward_to_next_line_start to restore the state of
17093         it->bidi_it after backing up to previous newline.  (Bug#9212)
17095 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
17097         * regex.c (re_comp): Protoize.
17098         (re_exec): Fix return type.
17099         (regexec): Fix type of `ret'.  (Bug#9203)
17101 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
17103         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17104         This is needed if max-image-size is a floating-point number.
17106 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
17108         * print.c (print_object): Print empty symbol as ##.
17110         * lread.c (read1): Read ## as empty symbol.
17112 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
17114         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17115         setting frame foreground color (Bug#9175).
17116         (x_set_background_color): Likewise.
17118         * nsmenu.m (-setText): Size tooltip dimensions precisely to
17119         contents (Bug#9176).
17120         (EmacsTooltip -init): Remove bezels and add shadows to
17121         tooltip windows.
17123         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17124         or scroll bar (Bug#8470).
17126         * nsfont.m (nsfont_open): Remove assignment to voffset and
17127         unnecessary vars hshink, expand, hd, full_height, min_height.
17128         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17130         * nsterm.h (nsfont_info): Remove voffset field.
17132 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
17134         Implement strike-through and overline on NextStep (Bug#8863).
17136         * nsfont.m (nsfont_open): Use underline position provided by font,
17137         instead of hard-coded value of 2.
17138         (nsfont_draw): Call ns_draw_text_decoration instead.
17140         * nsterm.h: Add declaration for ns_draw_text_decoration.
17142         * nsterm.m (ns_draw_text_decoration): New function for drawing
17143         underline, overline, and strike-through.
17144         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17145         ns_draw_text_decoration.  Change treatment of cursor drawing to
17146         accommodate underlining, etc.
17148 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
17150         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17151         default.
17153 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
17155         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17156         Without this fix, if a signal arrives just after memory fills up,
17157         'malloc' might be invoked reentrantly.
17159         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17160         In other words, assume that every image size is allowed, on non-X
17161         hosts.  This assumption is probably wrong, but it lets Emacs compile.
17163 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
17165         * regex.c (re_iswctype): Convert return values to boolean.
17167 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
17169         * xdisp.c (compute_display_string_pos): Don't use cached display
17170         string position if the buffer had its restriction changed.
17171         (Bug#9184)
17173 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
17175         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17177 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
17179         Integer signedness and overflow and related fixes.  (Bug#9079)
17181         * bidi.c: Integer size and overflow fixes.
17182         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17183         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17184         (bidi_cache_find_level_change, bidi_cache_ensure_space)
17185         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17186         (bidi_find_other_level_edge):
17187         Use ptrdiff_t instead of EMACS_INT where either will do.
17188         This works better on 32-bit hosts configured --with-wide-int.
17189         (bidi_cache_ensure_space): Check for size-calculation overflow.
17190         Use % rather than repeated addition, for better worst-case speed.
17191         Don't set bidi_cache_size until after xrealloc returns, because it
17192         might not return.
17193         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
17194         (bidi_cache_ensure_space): Also check that the bidi cache size
17195         does not exceed that of the largest Lisp string or buffer.  See Eli
17196         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
17198         * alloc.c (__malloc_size_t): Remove.
17199         All uses replaced by size_t.  See Andreas Schwab's note
17200         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17202         * image.c: Improve checking for integer overflow.
17203         (check_image_size): Assume that f is nonnull, since
17204         it is always nonnull in practice.  This is one less thing to
17205         worry about when checking for integer overflow later.
17206         (x_check_image_size): New function, which checks for integer
17207         overflow issues inside X.
17208         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17209         This removes the need for a memory_full check.
17210         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17211         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17212         (xbm_read_bitmap_data): Change locals back to 'int', since
17213         their values must fit in 'int'.
17214         (xpm_load_image, png_load, tiff_load):
17215         Invoke x_create_x_image_and_pixmap earlier,
17216         to avoid much needless work if the image is too large.
17217         (tiff_load): Treat overly large images as if
17218         x_create_x_image_and_pixmap failed, not as malloc failures.
17219         (gs_load): Use x_check_image_size.
17221         * gtkutil.c: Omit integer casts.
17222         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17223         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17225         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17227         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17228         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17229         would wrongly return t on a 64-bit host.
17231         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17232         The plain *_OVERFLOW macros run afoul of GCC bug 49705
17233         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17234         and therefore cause GCC to emit a bogus diagnostic in some cases.
17236         * image.c: Integer signedness and overflow and related fixes.
17237         This is not an exhaustive set of fixes, but it's time to
17238         record what I've got.
17239         (lookup_pixel_color, check_image_size): Remove redundant decls.
17240         (check_image_size): Don't assume that arbitrary EMACS_INT values
17241         fit in 'int', or that arbitrary 'double' values fit in 'int'.
17242         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17243         (tiff_load, imagemagick_load_image):
17244         Check for overflow in size calculations.
17245         (x_create_x_image_and_pixmap): Remove unnecessary test for
17246         xmalloc returning NULL; that can't happen.
17247         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17248         (xpm_color_bucket): Use better integer hashing function.
17249         (xpm_cache_color): Don't possibly over-allocate memory.
17250         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17251         (gif_memory_source):
17252         Use ptrdiff_t, not int or size_t, to record sizes.
17253         (png_load): Don't assume values greater than 2**31 fit in 'int'.
17254         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17255         either works, as we prefer signed integers.
17256         (tiff_read_from_memory, tiff_write_from_memory):
17257         Return tsize_t, not size_t, since that's what the TIFF API wants.
17258         (tiff_read_from_memory): Don't fail simply because the read would
17259         go past EOF; instead, return a short read.
17260         (tiff_load): Omit no-longer-needed casts.
17261         (Fimagemagick_types): Don't assume size fits into 'int'.
17263         Improve hashing quality when configured --with-wide-int.
17264         * fns.c (hash_string): New function, taken from sxhash_string.
17265         Do not discard information about ASCII character case; this
17266         discarding is no longer needed.
17267         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
17268         * lisp.h: Declare it.
17269         * lread.c (hash_string): Remove, since we now use fns.c's version.
17270         The fns.c version returns a wider integer if --with-wide-int is
17271         specified, so this should help the quality of the hashing a bit.
17273         * emacs.c: Integer overflow minor fix.
17274         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
17275         Define only if GNU_LINUX.
17276         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17278         * dispnew.c: Integer signedness and overflow fixes.
17279         Remove unnecessary forward decls, that were a maintenance hassle.
17280         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17281         All uses changed.
17282         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17283         (scrolling_window): Use ptrdiff_t, not int, for byte count.
17284         (prepare_desired_row, line_draw_cost):
17285         Use int, not unsigned, where either works.
17286         (save_current_matrix, restore_current_matrix):
17287         Use ptrdiff_t, not size_t, where either works.
17288         (init_display): Check for overflow more accurately, and without
17289         relying on undefined behavior.
17291         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17292         Remove, replacing with the new symbols in lisp.h.  All uses changed.
17293         * fileio.c (make_temp_name):
17294         * filelock.c (lock_file_1, lock_file):
17295         * xdisp.c (message_dolog):
17296         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17297         Use pMd etc. instead.
17298         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17299         replacing the pWIDE etc. symbols removed from editfns.c.
17301         * keyboard.h (num_input_events): Now uintmax_t.
17302         This is (very slightly) less likely to mess up due to wraparound.
17303         All uses changed.
17305         * buffer.c: Integer signedness fixes.
17306         (alloc_buffer_text, enlarge_buffer_text):
17307         Use ptrdiff_t rather than size_t when either will do, as we prefer
17308         signed integers.
17310         * alloc.c: Integer signedness and overflow fixes.
17311         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17312         (__malloc_size_t): Default to size_t, not to int.
17313         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17314         (Fgarbage_collect, mark_object_loop_halt, mark_object):
17315         Prefer ptrdiff_t to size_t when either would do, as we prefer
17316         signed integers.
17317         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17318         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17319         Now const.  Initialize with values that are in range even if char
17320         is signed.
17321         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17322         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
17323         These functions do the right thing with sizes > 2**32.
17324         (check_depth): Now ptrdiff_t, not int.
17325         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17326         Adjust to new way of storing sizes.  Check for size overflow bugs
17327         in rest of code.
17328         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
17329         slightly wrong anyway, as it missed one instance of
17330         XMALLOC_OVERRUN_CHECK_OVERHEAD.
17331         (refill_memory_reserve): Omit needless cast to size_t.
17332         (mark_object_loop_halt): Mark as externally visible.
17334         * xselect.c: Integer signedness and overflow fixes.
17335         (Fx_register_dnd_atom, x_handle_dnd_message):
17336         Use ptrdiff_t, not size_t, since we prefer signed.
17337         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17338         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17339         x_dnd_atoms_size and x_dnd_atoms_length.
17341         * doprnt.c: Prefer signed to unsigned when either works.
17342         * eval.c (verror):
17343         * doprnt.c (doprnt):
17344         * lisp.h (doprnt):
17345         * xdisp.c (vmessage):
17346         Use ptrdiff_t, not size_t, when using or implementing doprnt,
17347         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17348         prefer signed arithmetic to avoid comparison confusion.
17349         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17350         but is a bit tricky.
17352         Assume freestanding C89 headers, string.h, stdlib.h.
17353         * data.c, doprnt.c, floatfns.c, print.c:
17354         Include float.h unconditionally.
17355         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17356         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
17357         * regex.c: Likewise for stddef.h, string.h.
17358         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
17359         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17360         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17361         (STDC_HEADERS): Remove obsolete defines.
17362         * sysdep.c: Include limits.h unconditionally.
17364         Assume support for memcmp, memcpy, memmove, memset.
17365         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17366         * regex.c (memcmp, memcpy):
17367         Remove; we assume C89 now.
17369         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17370         (__malloc_safe_bcopy): Remove; no longer needed.
17372         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
17373         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
17374         well either way, and we prefer signed to unsigned.
17376 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17378         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17379         closes the connection while we're reading (bug#9182).
17381 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
17383         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17384         are specified (Bug#9168).
17386 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
17388         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17389         Found by GCC static checking and --with-wide-int on a 32-bit host.
17391 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
17393         * xdisp.c (compute_display_string_pos): Fix logic of caching
17394         previous display string position.  Initialize cached_prev_pos to
17395         -1.  Fixes slow-down at the beginning of a buffer.
17397 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
17399         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17400         for attrs[LFACE_FONTSET_INDEX].
17402 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
17404         * xml.c (parse_region): Remove unused local
17405         that was recently introduced.
17407 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
17409         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17410         2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17412         * xdisp.c (move_it_in_display_line_to): Record the best matching
17413         position for TO_CHARPOS while scanning the line, and restore it on
17414         exit if none of the characters scanned was an exact match.
17415         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
17416         when exact match is impossible due to invisible text, and the
17417         lines are truncated.
17419 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
17421         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17422         for OSX >= 10.7.
17424 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
17426         Fix a significant slow-down of cursor motion with C-n, C-p,
17427         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17428         auto-repeat under bidi redisplay in fontified buffers.
17429         * xdisp.c (compute_stop_pos_backwards): New function.
17430         (next_element_from_buffer): Call compute_stop_pos_backwards to
17431         find a suitable prev_stop when we find ourselves before
17432         base_level_stop.
17433         (reseat): Don't look for prev_stop, as that could mean a very long
17434         run.
17435         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17436         <cached_disp_overlay_modiff>: Cache for last found display string
17437         position.
17438         (compute_display_string_pos): Return the cached position if asked
17439         about the same buffer in the same area of character positions, and
17440         the buffer wasn't changed since the time the display string
17441         position was cached.
17443 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
17445         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17446         is an integer, which is important for empty lines.  (Bug#9149)
17448 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
17450         * frame.c (Fmodify_frame_parameters): In tty case, update the
17451         default face if necessary (Bug#4238).
17453 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
17455         * editfns.c (Fstring_to_char): No need to explain what a character
17456         is in the docstring (Bug#6576).
17458 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17460         * xml.c (parse_region): Make sure we always return a tree.
17462 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
17464         * xml.c (parse_region): If a document contains only comments,
17465         return that, too.
17467 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17469         * xml.c (make_dom): Return comments, too.
17471 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
17473         Port to OpenBSD.
17474         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17475         and the surrounding thread.
17476         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17477         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
17478         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17479         timer goes off.
17480         * s/openbsd.h (BROKEN_SIGIO): Define.
17481         * unexelf.c (unexec) [__OpenBSD__]:
17482         Don't update the .mdebug section of the Alpha COFF symbol table.
17484 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17486         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17487         (bug#8460).
17489 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
17491         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17492         This fixes some race conditions on the permissions of any newly
17493         created file.
17495         * alloc.c (valid_pointer_p): Use pipe, not open.
17496         This fixes some permissions issues when debugging.
17498         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
17499         If fchown fails to set both uid and gid, try to set just gid,
17500         as that is sometimes allowed.  Adjust the file's mode to eliminate
17501         setuid or setgid bits that are inappropriate if fchown fails.
17503 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
17505         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17506         to compare Lisp_Objects.
17507         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17508         global_gnutls_log_level, don't mistake it for a Lisp_Object.
17509         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17511 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
17513         * lread.c (read_integer): Unread even EOF character.
17514         (read1): Likewise.  Properly record start position of symbol.
17516         * lread.c (read1): Read `#:' as empty uninterned symbol if no
17517         symbol character follows.
17519 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
17521         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
17522         This works around a problem with the previous change to Fcopy_file.
17523         Recent glibc declares fchown with __attribute__((warn_unused_result)),
17524         and without this change, GCC might complain about discarding
17525         fchown's return value.
17527 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
17529         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17531 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
17533         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
17535 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17537         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17538         it's used from the C level.
17540         * process.c: Use the same condition for POLL_FOR_INPUT in both
17541         keyboard.c and process.c (bug#1858).
17543 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
17545         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17546         (Fgnutls_boot): Use it.
17548 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
17550         * doc.c (Fsubstitute_command_keys): Revert last change.
17552 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17554         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17555         quotes the next character, and doesn't affect other longer
17556         sequences (bug#8935).
17558         * lread.c (syms_of_lread): Clarify that is isn't only
17559         `eval-buffer' and `eval-defun' that's affected by
17560         `lexical-binding' (bug#8460).
17562 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
17564         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
17565         bidi redisplay when a line includes both an image and is truncated.
17567 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
17569         Fix minor problems found by static checking.
17570         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17571         (elsz): Now a signed constant, not a size_t var.  We prefer signed
17572         types to unsigned, to avoid integer comparison confusion.  Without
17573         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17574         "cannot optimize loop, the loop counter may overflow", a symptom
17575         of the confusion.
17576         * indent.c (Fvertical_motion): Mark locals as initialized.
17577         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17579 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17581         * search.c (Fre_search_backward): Mention `case-fold-search' in
17582         all the re_search_* functions (bug#8138).
17584         * keyboard.c (Fopen_dribble_file): Document when the file is
17585         closed (bug#8056).
17587 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
17589         * bidi.c (bidi_dump_cached_states): Fix format of displaying
17590         bidi_cache_idx.
17592         Support bidi reordering of display and overlay strings.
17593         * xdisp.c (compute_display_string_pos)
17594         (compute_display_string_end): Accept additional argument STRING.
17595         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17596         (reseat_to_string): Initialize bidi_it->string.s and
17597         bidi_it->string.schars.
17598         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
17599         NULL (avoids a crash in bidi_paragraph_init).
17600         Initialize itb.string.lstring.
17601         (init_iterator): Call bidi_init_it only of a valid
17602         buffer position was specified.  Initialize paragraph_embedding to
17603         L2R.
17604         (reseat_to_string): Initialize the bidi iterator.
17605         (display_string): If we need to ignore text properties of
17606         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
17607         original value of -1 will not work with bidi.)
17608         (compute_display_string_pos): First arg is now struct
17609         `text_pos *'; all callers changed.  Support display properties on
17610         Lisp strings.
17611         (compute_display_string_end): Support display properties on Lisp
17612         strings.
17613         (init_iterator, reseat_1, reseat_to_string): Initialize the
17614         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17615         when iterating on a string not from display properties).
17616         (compute_display_string_pos, compute_display_string_end):
17617         Fix calculation of the object to scan.  Fixes an error when using
17618         arrow keys.
17619         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
17620         base_level_stop; instead, set base_level_stop to BEGV.
17621         Fixes crashes in vertical-motion.
17622         (next_element_from_buffer): Improve commentary for when
17623         the iterator is before prev_stop.
17624         (init_iterator): Initialize bidi_p from the default value of
17625         bidi-display-reordering, not from buffer-local value.  Use the
17626         buffer-local value only if initializing for buffer iteration.
17627         (handle_invisible_prop): Support invisible properties on strings
17628         that are being bidi-reordered.
17629         (set_iterator_to_next): Support bidi reordering of C strings and
17630         Lisp strings.
17631         (next_element_from_string): Support bidi reordering of Lisp
17632         strings.
17633         (handle_stop_backwards): Support Lisp strings as well.
17634         (display_string): Support display of R2L glyph rows.
17635         Use IT_STRING_CHARPOS when displaying from a Lisp string.
17636         (init_iterator): Don't initialize it->bidi_p for strings
17637         here.
17638         (reseat_to_string): Initialize it->bidi_p for strings here.
17639         (next_element_from_string, next_element_from_c_string)
17640         (next_element_from_buffer): Add xassert's for correspondence
17641         between IT's object being iterated and it->bidi_it.string
17642         structure.
17643         (face_before_or_after_it_pos): Support bidi iteration.
17644         (next_element_from_c_string): Handle the case of the first string
17645         character that is not the first one in the visual order.
17646         (get_visually_first_element): New function, refactored from common
17647         parts of next_element_from_buffer, next_element_from_string, and
17648         next_element_from_c_string.
17649         (tool_bar_lines_needed, redisplay_tool_bar)
17650         (display_menu_bar): Force left-to-right direction.  Add a FIXME
17651         comment for making that be controlled by a user option.
17652         (push_it, pop_it): Save and restore the state of the
17653         bidi iterator.  Save and restore the bidi_p flag.
17654         (pop_it): Iterate out of display property for string iteration as
17655         well.
17656         (iterate_out_of_display_property): Support iteration over strings.
17657         (handle_single_display_spec): Set up it->bidi_it for iteration
17658         over a display string, and call bidi_init_it.
17659         (handle_single_display_spec, next_overlay_string)
17660         (get_overlay_strings_1, push_display_prop): Set up the bidi
17661         iterator for displaying display or overlay strings.
17662         (forward_to_next_line_start): Don't use the shortcut if
17663         bidi-iterating.
17664         (back_to_previous_visible_line_start): If handle_display_prop
17665         pushed the iterator stack, restore the internal state of the bidi
17666         iterator by calling bidi_pop_it same number of times.
17667         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17668         and we are bidi-iterating, don't decrement the iterator position;
17669         instead, set the first_elt flag in the bidi iterator, to produce
17670         the same effect.
17671         (reseat_1): Remove redundant setting of string_from_display_prop_p.
17672         (push_display_prop): xassert that we are iterating a buffer.
17673         (push_it, pop_it): Save and restore paragraph_embedding member.
17674         (handle_single_display_spec, next_overlay_string)
17675         (get_overlay_strings_1, reseat_1, reseat_to_string)
17676         (push_display_prop): Set up the `unibyte' member of bidi_it.string
17677         correctly.  Don't assume unibyte strings are not bidi-reordered.
17678         (compute_display_string_pos)
17679         (compute_display_string_end): Fix handling the case of C string.
17680         (push_it, pop_it): Save and restore from_disp_prop_p.
17681         (handle_single_display_spec, push_display_prop): Set the
17682         from_disp_prop_p flag.
17683         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17684         (pop_it): Call iterate_out_of_display_property only if we are
17685         popping after iteration over a string that came from a display
17686         property.  Fix a typo in popping stretch info.  Add an assertion
17687         for verifying that the iterator position is in sync with the bidi
17688         iterator.
17689         (handle_single_display_spec, get_overlay_strings_1)
17690         (push_display_prop): Fix initialization of paragraph direction for
17691         string when that of the parent object is not yet determined.
17692         (reseat_1): Call bidi_init_it to resync the bidi
17693         iterator with IT's position.  (Bug#7616)
17694         (find_row_edges): If ROW->start.pos gives position
17695         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
17696         (handle_stop, back_to_previous_visible_line_start, reseat_1):
17697         Reset the from_disp_prop_p flag.
17698         (SAVE_IT, RESTORE_IT): New macros.
17699         (pos_visible_p, face_before_or_after_it_pos)
17700         (back_to_previous_visible_line_start)
17701         (move_it_in_display_line_to, move_it_in_display_line)
17702         (move_it_to, move_it_vertically_backward, move_it_by_lines)
17703         (try_scrolling, redisplay_window, display_line): Use them when
17704         saving a temporary copy of the iterator and restoring it back.
17705         (back_to_previous_visible_line_start, reseat_1)
17706         (init_iterator): Empty the bidi cache "stack".
17707         (move_it_in_display_line_to): If iterator ended up at
17708         EOL, but we never saw any buffer positions smaller than
17709         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
17710         motion in bidi-reordered lines.
17711         (move_it_in_display_line_to): Record prev_method and prev_pos
17712         immediately before the call to set_iterator_to_next.  Fixes cursor
17713         motion in bidi-reordered lines with stretch glyphs and strings
17714         displayed in margins.  (Bug#8133) (Bug#8867)
17715         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17716         TO_CHARPOS.
17717         (pos_visible_p): Support positions in bidi-reordered lines.
17718         Save and restore bidi cache.
17720         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17721         (bidi_paragraph_info): Delete unused struct.
17722         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17723         (bidi_cache_start): New variable.
17724         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17725         to zero.
17726         (bidi_cache_fetch_state, bidi_cache_search)
17727         (bidi_cache_find_level_change, bidi_cache_iterator_state)
17728         (bidi_cache_find, bidi_peek_at_next_level)
17729         (bidi_level_of_next_char, bidi_find_other_level_edge)
17730         (bidi_move_to_visually_next): Compare cache index with
17731         bidi_cache_start rather than with zero.
17732         (bidi_fetch_char): Accept new argument STRING; all callers
17733         changed.  Support iteration over a string.  Support strings with
17734         display properties.  Support unibyte strings.  Fix the type of
17735         `len' according to what STRING_CHAR_AND_LENGTH expects.
17736         (bidi_paragraph_init, bidi_resolve_explicit_1)
17737         (bidi_resolve_explicit, bidi_resolve_weak)
17738         (bidi_level_of_next_char, bidi_move_to_visually_next):
17739         Support iteration over a string.
17740         (bidi_set_sor_type, bidi_resolve_explicit_1)
17741         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17742         can now be zero (for strings); special values 0 and -1 were
17743         changed to -1 and -2, respectively.
17744         (bidi_char_at_pos): New function.
17745         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17746         Call it instead of FETCH_MULTIBYTE_CHAR.
17747         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17748         initialized to valid values.
17749         (bidi_init_it): Don't initialize charpos and bytepos with invalid
17750         values.
17751         (bidi_level_of_next_char): Allow the sentinel "position" to pass
17752         the test for valid cached positions.  Fix the logic for looking up
17753         the sentinel state in the cache.  GCPRO the Lisp string we are
17754         iterating.
17755         (bidi_push_it, bidi_pop_it): New functions.
17756         (bidi_initialize): Initialize the bidi cache start stack pointer.
17757         (bidi_cache_ensure_space): New function, refactored from part of
17758         bidi_cache_iterator_state.  Don't assume the required size is just
17759         one BIDI_CACHE_CHUNK away.
17760         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17761         (bidi_count_bytes, bidi_char_at_pos): New functions.
17762         (bidi_cache_search): Don't assume bidi_cache_last_idx is
17763         always valid if bidi_cache_idx is valid.
17764         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17765         is valid if it's going to be used.
17766         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17767         (bidi_cache_fetch_state, bidi_cache_search)
17768         (bidi_cache_find_level_change, bidi_cache_ensure_space)
17769         (bidi_cache_iterator_state, bidi_cache_find)
17770         (bidi_find_other_level_edge, bidi_cache_start_stack):
17771         All variables related to cache indices are now EMACS_INT.
17773         * dispextern.h (struct bidi_string_data): New structure.
17774         (struct bidi_it): New member `string'.  Make flag members be 1-bit
17775         fields, and put them last in the struct.
17776         (compute_display_string_pos, compute_display_string_end):
17777         Update prototypes.
17778         (bidi_push_it, bidi_pop_it): Add prototypes.
17779         (struct iterator_stack_entry): New members bidi_p,
17780         paragraph_embedding, and from_disp_prop_p.
17781         (struct it): Member bidi_p is now a bit field 1 bit wide.
17782         (bidi_shelve_cache, bidi_unshelve_cache):
17783         Declare prototypes.
17785         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17786         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17787         and vector-like objects.
17789         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17790         cache around display iteration.
17792         * window.c (Fwindow_end, window_scroll_pixel_based)
17793         (displayed_window_lines, Frecenter): Save and restore the bidi
17794         cache around display iteration.
17796 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17798         * editfns.c (Fdelete_region): Clarify the use of the named
17799         parameters (bug#6788).
17801 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
17803         * indent.c (Fvertical_motion): Set and restore w->pointm when
17804         saving and restoring the window's buffer (Bug#9006).
17806 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17808         * editfns.c (Fstring_to_char): Clarify just what is returned
17809         (bug#6576).  Text by Eli Zaretskii.
17811 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
17813         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17815 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
17817         * buffer.c (mmap_find): Fix a typo.
17819 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
17821         Fix execution of x selection hooks.
17822         * xselect.c (Qx_lost_selection_functions)
17823         (Qx_sent_selection_functions): New vars.
17824         (syms_of_xselect): DEFSYM them.
17825         (x_handle_selection_request): Pass Qx_sent_selection_functions
17826         rather than Vx_sent_selection_functions to Frun_hook_with_args.
17827         (x_handle_selection_clear,x_clear_frame_selections):
17828         Pass Qx_lost_selection_functions rather than
17829         Vx_lost_selection_functions to Frun_hook_with_args.
17831 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
17833         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
17834         The old code sometimes used this field without initializing it.
17836         * alloc.c (gc_sweep): Don't read past end of array.
17837         In theory, the old code could also have corrupted Emacs internals,
17838         though it'd be very unlikely.
17840 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
17842         * character.c (Fcharacterp): Don't advertise optional ignored
17843         argument.  (Bug#4026)
17845 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17847         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17848         key" (bug#4257).
17850         * window.c (Fset_window_start): Doc fix (bug#4199).
17851         (Fset_window_hscroll): Ditto.
17853 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
17855         Fix minor new problems caught by GCC 4.6.1.
17856         * term.c (init_tty): Remove unused local.
17857         * xsettings.c (store_monospaced_changed): Define this function only
17858         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
17859         not used otherwise.
17861 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
17863         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17865 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17867         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17868         are the mini-buffer and the echo area (bug#3320).
17870         * term.c (init_tty): Remove support for supdup, c10 and perq
17871         terminals, which are no longer supported (bug#1482).
17873 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
17875         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17877 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
17879         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17880         for non-popups (Bug#3642).
17882 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
17884         * alloc.c (reset_malloc_hooks): Protoize.
17885         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
17886         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17887         * cm.c (losecursor): Likewise.
17888         * data.c (fmod): Likewise.
17889         * dispnew.c (swap_glyphs_in_rows): Likewise.
17890         * emacs.c (memory_warning_signal): Likewise.
17891         * floatfns.c (float_error): Likewise.
17892         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17893         (otf_open, font_otf_capability, generate_otf_features)
17894         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17895         Likewise.
17896         * image.c (pbm_read_file): Likewise.
17897         * indent.c (string_display_width): Likewise.
17898         * intervals.c (check_for_interval, search_for_interval)
17899         (inc_interval_count, count_intervals, root_interval)
17900         (adjust_intervals_for_insertion, make_new_interval): Likewise.
17901         * lread.c (defalias): Likewise.
17902         * ralloc.c (r_alloc_check): Likewise.
17903         * regex.c (set_image_of_range_1, set_image_of_range)
17904         (regex_grow_registers): Likewise.
17905         * sysdep.c (strerror): Likewise.
17906         * termcap.c (valid_filename_p, tprint, main): Likewise.
17907         * tparam.c (main): Likewise.
17908         * unexhp9k800.c (run_time_remap, save_data_space)
17909         (update_file_ptrs, read_header, write_header, calculate_checksum)
17910         (copy_file, copy_rest, display_header): Likewise.
17911         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17912         Likewise.
17913         * xdisp.c (check_it): Likewise.
17914         * xfaces.c (register_color, unregister_color, unregister_colors):
17915         Likewise.
17916         * xfns.c (print_fontset_result): Likewise.
17917         * xrdb.c (member, fatal, main): Likewise.
17919 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
17921         Fix minor problems found by static checking (Bug#9031).
17922         * chartab.c (char_table_set_range, map_sub_char_table):
17923         Remove unused locals.
17924         (uniprop_table): Now static.
17925         * composite.c (_work_char): Remove unused static var.
17927 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
17929         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17931 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
17933         * gtkutil.c (qttip_cb): Remove code without function.
17935 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
17937         * w32.c (pthread_sigmask): New stub.
17939 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
17941         Use pthread_sigmask, not sigprocmask (Bug#9010).
17942         sigprocmask is portable only for single-threaded applications, and
17943         Emacs can be multi-threaded when it uses GTK.
17944         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17945         (LIBES): Use it.
17946         * callproc.c (Fcall_process):
17947         * process.c (create_process):
17948         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17949         Use pthread_sigmask, not sigprocmask.
17951 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
17953         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17954         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17955         wrong (Bug#8591).
17957 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
17959         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17960         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17961         (xg_hide_tooltip): Fix comment.
17963         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17964         in registerServicesMenuSendTypes.
17965         (validRequestorForSendType): Don't check ns_return_types.
17967         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17968         ns_return_type.
17970 2011-07-08  Jason Rumney  <jasonr@gnu.org>
17972         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17973         SH_SHOW for hidden windows (Bug#5482).
17975         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17976         frame struct members of non-existent frames (Bug#6284).
17978 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
17980         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17981         variable firstTime not needed on OSX >= 10.6.
17982         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17983         >= 10.5.  Use setKnobProportion, setDoubleValue.
17985         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17986         (MAC_OS_X_VERSION_10_5): Define if not defined.
17987         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17988         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17989         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17991         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
17992         cString and lossyCString on OSX >= 10.4.
17994         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
17995         sizeToFit on OSX >= 10.2.
17997         * nsimage.m (allocInitFromFile): Don't use deprecated method
17998         bestRepresentationForDevice on OSX >= 10.6.
18000         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18001         to avoid warning.
18003         * emacs.c: Declare unexec_init_emacs_zone.
18005         * nsgui.h: Fix compiler warning about gnulib redefining verify.
18007         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18009         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18010         on svcsMenu (Bug#8842).
18012         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18013         ns_return_types.
18014         (Fns_list_services): Just return Qnil on 10.6, code not working there.
18016         * nsterm.m (QUTF8_STRING): Declare.
18017         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18018         (validRequestorForSendType): Return type is (id).
18019         Change indexOfObjectIdenticalTo to indexOfObject.
18020         Check if we have local selection before returning self (Bug#8842).
18021         (writeSelectionToPasteboard): Put local selection into paste board
18022         if we have a local selection (Bug#8842).
18023         (syms_of_nsterm): DEFSYM QUTF8_STRING.
18025         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18026         (ns_get_local_selection): Declare.
18028 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
18030         * keymap.c (describe_map_tree): Don't insert a double newline at
18031         the end of the buffer (bug#1169) and return whether we inserted
18032         something.
18034         * callint.c (Fcall_interactively): Change "reading args" to
18035         "providing args" to try to clarify what it does (bug#1010).
18037 2011-07-07  Kenichi Handa  <handa@m17n.org>
18039         * composite.c (composition_compute_stop_pos): Ignore a static
18040         composition starting before CHARPOS (Bug#8915).
18042         * xdisp.c (handle_composition_prop): Likewise.
18044 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
18046         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18047         (Bug#9015)
18049 2011-07-07  Kenichi Handa  <handa@m17n.org>
18051         * character.h (unicode_category_t): New enum type.
18053         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18054         (Qchar_code_property_table): New variable.
18055         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18056         (UNIPROP_COMPRESSED_FORM_P): New macros.
18057         (char_table_ascii): Uncompress the compressed values.
18058         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
18059         Uncompress the compressed values.
18060         (sub_char_table_ref_and_range): Likewise.
18061         (char_table_ref_and_range): Uncompress the compressed values.
18062         (sub_char_table_set): New arg is_uniprop.  Callers changed.
18063         Uncompress the compressed values.
18064         (sub_char_table_set_range): Args changed.  Callers changed.
18065         (char_table_set_range): Adjuted for the above change.
18066         (map_sub_char_table): Delete args default_val and parent.  Add arg
18067         top.  Give decoded values to a Lisp function.
18068         (map_char_table): Adjust for the above change.  Give decoded
18069         values to a Lisp function.  Gcpro more variables.
18070         (uniprop_table_uncompress)
18071         (uniprop_decode_value_run_length): New functions.
18072         (uniprop_decoder, uniprop_decoder_count): New variables.
18073         (uniprop_get_decoder, uniprop_encode_value_character)
18074         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18075         New functions.
18076         (uniprop_encoder, uniprop_encoder_count): New variables.
18077         (uniprop_get_encoder, uniprop_table)
18078         (Funicode_property_table_internal, Fget_unicode_property_internal)
18079         (Fput_unicode_property_internal): New functions.
18080         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18081         Sunicode_property_table_internal, Sget_unicode_property_internal,
18082         and Sput_unicode_property_internal.  Defvar_lisp
18083         char-code-property-alist.
18085         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
18086         Vunicode_category_table.
18088         * font.c (font_range): Adjust for the change of
18089         Vunicode_category_table.
18091 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
18093         * m/iris4d.h: Remove file, move contents ...
18094         * s/irix6-5.h: ... here.
18096 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
18098         Remove unportable assumption about struct layout (Bug#8884).
18099         * alloc.c (mark_buffer):
18100         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18101         (clone_per_buffer_values): Don't assume that
18102         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18103         This isn't true in general, and it's particularly not true
18104         if Emacs is configured with --with-wide-int.
18105         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18106         New macros, used in the buffer.c change.
18108 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
18110         * xsettings.c: Use both GConf and GSettings if both are available.
18111         (store_config_changed_event): Add comment.
18112         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18113         (store_tool_bar_style_changed): New functions.
18114         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
18115         (struct xsettings): Move font inside HAVE_XFT.
18116         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
18117         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
18118         Move inside HAVE_XFT.
18119         (something_changed_gsettingsCB): Rename from something_changedCB.
18120         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18121         also.
18122         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
18123         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
18124         (something_changed_gconfCB): Rename from something_changedCB.
18125         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18126         (parse_settings): Move check for font inside HAVE_XFT.
18127         (read_settings, apply_xft_settings): Add comment.
18128         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
18129         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
18130         call store_font_name_changed.
18131         (xft_settings_event): Add comment.
18132         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
18133         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
18134         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
18135         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
18136         (xsettings_initialize): Call init_gsettings last.
18137         (xsettings_get_system_font, xsettings_get_system_normal_font):
18138         Add comment.
18140 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
18142         Random fixes.  E.g., (random) never returned negative values.
18143         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18144         subseconds part to the entropy, as that's a bit more random.
18145         Prefer signed to unsigned, since the signedness doesn't matter and
18146         in general we prefer signed.  When given a limit, use a
18147         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18148         latter isn't right if USE_2_TAGS_FOR_INTS.
18149         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18150         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
18152 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
18154         * textprop.c (text_property_stickiness):
18155         Obey Vtext_property_default_nonsticky.
18156         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18157         * w32fns.c (syms_of_w32fns):
18158         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18160 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
18162         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18163         This is more efficient than Ffile_directory_p and avoids a minor race.
18165 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
18167         * buffer.c (Foverlay_put): Say what the return value is
18168         (bug#7835).
18170         * fileio.c (barf_or_query_if_file_exists): Check first if the file
18171         is a directory before asking whether to use the file name
18172         (bug#7564).
18173         (barf_or_query_if_file_exists): Make the "File is a directory"
18174         error be more correct.
18176         * fns.c (Frequire): Remove the mention of the .gz files, since
18177         that's installation-specific, but keep the mention of
18178         `get-load-suffixes'.
18180 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
18182         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18183         Report string overflow if the output is too long.
18185 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
18187         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18188         (syms_of_gnutls): Remove duplicate DEFSYM for
18189         Qgnutls_bootprop_verify_hostname_error, an error for
18190         Qgnutls_bootprop_verify_error (which is no longer used).
18192         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18193         unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
18194         Also (re)move comments that are misplaced or no longer relevant.
18196 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
18198         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18200 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
18202         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18203         and background color parameters if they have been changed.
18205 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
18207         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18209 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
18211         * xsettings.c (SYSTEM_FONT): Define only when used.
18212         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18214         * keymap.c (access_keymap_1): Now static.
18216 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
18218         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18219         leave any prefix arg for the up event (Bug#1586).
18221 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
18223         * lread.c (syms_of_lread): Mention single symbols defined by
18224         `defvar' or `defconst' (bug#7154).
18226         * fns.c (Frequire): Mention .el.gz files (bug#7314).
18227         (Frequire): Mention get-load-suffixes.
18229 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
18231         * window.h (window): Remove clone_number slot.
18232         * window.c (Fwindow_clone_number, Fset_window_clone_number):
18233         Remove.
18234         (make_parent_window, make_window, saved_window)
18235         (Fset_window_configuration, save_window_save): Don't deal with
18236         clone numbers.
18237         * buffer.c (Qclone_number): Remove declaration.
18238         (sort_overlays, overlay_strings): Don't deal with clone numbers.
18240 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
18242         Add multiple inheritance to keymaps.
18243         * keymap.c (Fmake_composed_keymap): New function.
18244         (Fset_keymap_parent): Simplify.
18245         (fix_submap_inheritance): Remove.
18246         (access_keymap_1): New function extracted from access_keymap to handle
18247         embedded parents and handle lists of maps.
18248         (access_keymap): Use it.
18249         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18250         (Fcopy_keymap): Handle embedded parents.
18251         (Fcommand_remapping, define_as_prefix): Simplify.
18252         (Fkey_binding): Simplify.
18253         (syms_of_keymap): Move minibuffer-local-completion-map,
18254         minibuffer-local-filename-completion-map,
18255         minibuffer-local-must-match-map, and
18256         minibuffer-local-filename-must-match-map to Elisp.
18257         (syms_of_keymap): Defsubr make-composed-keymap.
18258         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18259         (parse_menu_item): Trivial simplification.
18261 2011-07-01  Glenn Morris  <rgm@gnu.org>
18263         * Makefile.in (SETTINGS_LIBS): Fix typo.
18265 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
18267         * coding.c (Fencode_coding_string): Record the last coding system
18268         used, as the function doc string says (bug#8738).
18270 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
18272         * xsettings.c (store_monospaced_changed): Take new font as arg and
18273         check for change against current_mono_font.
18274         (EMACS_TYPE_SETTINGS): Remove this and related defines.
18275         (emacs_settings_constructor, emacs_settings_get_property)
18276         (emacs_settings_set_property, emacs_settings_class_init)
18277         (emacs_settings_init, gsettings_obj): Remove.
18278         (something_changedCB): New function for HAVE_GSETTINGS.
18279         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18280         with value as argument.
18281         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18282         g_settings_new (Bug#8967).  Do not create gsettings_obj.
18283         Remove calls to g_settings_bind.  Connect something_changedCB to
18284         "changed".
18286         * xgselect.c: Add defined (HAVE_GSETTINGS).
18287         (xgselect_initialize): Ditto.
18289         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18290         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18291         xg_select.
18293 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
18295         * eval.c (struct backtrace): Simplify and port the data structure.
18296         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18297         signed bit field, as this assumption is not portable and it makes
18298         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
18299         "char debug_on_exit : 1" as this is not portable either; instead,
18300         use the portable "unsigned int debug_on_exit : 1".  Remove unused
18301         member evalargs.  Remove obsolete comments about cc bombing out.
18303 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
18305         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
18306         Let HAVE_GSETTINGS override HAVE_GCONF.
18307         (store_monospaced_changed): New function.
18308         (EMACS_SETTINGS): A new type derived from GObject to handle
18309         GSettings notifications.
18310         (emacs_settings_constructor, emacs_settings_get_property)
18311         (emacs_settings_set_property, emacs_settings_class_init):
18312         New functions.
18313         (gsettings_client, gsettings_obj): New variables.
18314         (GSETTINGS_SCHEMA): New define.
18315         (something_changedCB): Call store_monospaced_changed.
18316         (init_gsettings): New function.
18317         (xsettings_initialize): Call init_gsettings.
18318         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18319         to NULL.
18321         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
18322         GCONF_CFLAGS/LIBS.
18324 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
18326         * window.c (resize_root_window, grow_mini_window)
18327         (shrink_mini_window): Rename Qresize_root_window to
18328         Qwindow_resize_root_window and Qresize_root_window_vertically to
18329         Qwindow_resize_root_window_vertically.
18331 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
18333         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18335 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
18337         * makefile.w32-in: Redesign dependencies so they reflect more
18338         clearly which files are directly included by each source file,
18339         and not through other includes.
18341 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
18343         * buffer.c (Qclone_number): Declare static and DEFSYM it.
18344         (sort_overlays, overlay_strings): When an overlay's clone number
18345         matches the window's clone number process the overlay even if
18346         the overlay's window property doesn't match the current window.
18348         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18349         (Fwindow_hchild): Rename to Fwindow_left_child.
18350         (Fwindow_next): Rename to Fwindow_next_sibling.
18351         (Fwindow_prev): Rename to Fwindow_prev_sibling.
18352         (resize_window_check): Rename to window_resize_check.
18353         (resize_window_apply): Rename to window_resize_apply.
18354         (Fresize_window_apply): Rename to Fwindow_resize_apply.
18355         (Fdelete_other_windows_internal, resize_frame_windows)
18356         (Fsplit_window_internal, Fdelete_window_internal)
18357         (grow_mini_window, shrink_mini_window)
18358         (Fresize_mini_window_internal): Fix callers accordingly.
18360 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
18362         * emacsgtkfixed.h: State that this is only used with Gtk+3.
18363         (emacs_fixed_set_min_size): Remove.
18364         (emacs_fixed_new): Take frame as argument.
18366         * emacsgtkfixed.c: State that this is only used with Gtk+3.
18367         (_EmacsFixedPrivate): Remove minwidth/height.
18368         Add struct frame *f.
18369         (emacs_fixed_init): Initialize priv->f.
18370         (get_parent_class, emacs_fixed_set_min_size): Remove.
18371         (emacs_fixed_new): Set priv->f to argument.
18372         (emacs_fixed_get_preferred_width)
18373         (emacs_fixed_get_preferred_height): Use min_width/height from
18374         frames size_hint to set minimum and natural (Bug#8919).
18375         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18376         and use min_width/height from frames size_hint to set
18377         min_width/height (Bug#8919).
18379         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
18380         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18381         Fix indentation.
18383 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
18385         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18386         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18387         called at ZV.
18389 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
18391         * process.c (wait_reading_process_output): Bypass select if
18392         waiting for a cell while ignoring keyboard input, and input is
18393         pending.  Suggested by Jan Djärv (Bug#8869).
18395 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
18397         Use gnulib's dup2 module instead of rolling our own.
18398         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18400 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
18402         * dispnew.c (scrolling_window): Before scrolling, turn off a
18403         mouse-highlight in the window being scrolled.
18405 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
18407         Move DEFSYM to lisp.h and use everywhere.
18409         * character.h (DEFSYM): Move declaration...
18410         * lisp.h (DEFSYM): ...here.
18412         * gnutls.c:
18413         * minibuf.c:
18414         * w32menu.c:
18415         * w32proc.c:
18416         * w32select.c: Don't include character.h.
18418         * alloc.c (syms_of_alloc):
18419         * buffer.c (syms_of_buffer):
18420         * bytecode.c (syms_of_bytecode):
18421         * callint.c (syms_of_callint):
18422         * casefiddle.c (syms_of_casefiddle):
18423         * casetab.c (init_casetab_once):
18424         * category.c (init_category_once, syms_of_category):
18425         * ccl.c (syms_of_ccl):
18426         * cmds.c (syms_of_cmds):
18427         * composite.c (syms_of_composite):
18428         * dbusbind.c (syms_of_dbusbind):
18429         * dired.c (syms_of_dired):
18430         * dispnew.c (syms_of_display):
18431         * doc.c (syms_of_doc):
18432         * editfns.c (syms_of_editfns):
18433         * emacs.c (syms_of_emacs):
18434         * eval.c (syms_of_eval):
18435         * fileio.c (syms_of_fileio):
18436         * fns.c (syms_of_fns):
18437         * frame.c (syms_of_frame):
18438         * fringe.c (syms_of_fringe):
18439         * insdel.c (syms_of_insdel):
18440         * keymap.c (syms_of_keymap):
18441         * lread.c (init_obarray, syms_of_lread):
18442         * macros.c (syms_of_macros):
18443         * msdos.c (syms_of_msdos):
18444         * print.c (syms_of_print):
18445         * process.c (syms_of_process):
18446         * search.c (syms_of_search):
18447         * sound.c (syms_of_sound):
18448         * syntax.c (init_syntax_once, syms_of_syntax):
18449         * terminal.c (syms_of_terminal):
18450         * textprop.c (syms_of_textprop):
18451         * undo.c (syms_of_undo):
18452         * w32.c (globals_of_w32):
18453         * window.c (syms_of_window):
18454         * xdisp.c (syms_of_xdisp):
18455         * xfaces.c (syms_of_xfaces):
18456         * xfns.c (syms_of_xfns):
18457         * xmenu.c (syms_of_xmenu):
18458         * xsettings.c (syms_of_xsettings):
18459         * xterm.c (syms_of_xterm): Use DEFSYM.
18461 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
18463         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
18465 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
18467         Integer and buffer overflow fixes (Bug#8873).
18469         * print.c (printchar, strout): Check for string overflow.
18470         (PRINTPREPARE, printchar, strout):
18471         Don't set size unless allocation succeeds.
18473         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18474         for sizes.  Check for string overflow more accurately.
18475         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18477         * macros.c: Integer and buffer overflow fixes.
18478         * keyboard.h (struct keyboard.kbd_macro_bufsize):
18479         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18480         Use ptrdiff_t, not int, for sizes.
18481         Don't increment bufsize until after realloc succeeds.
18482         Check for size-calculation overflow.
18483         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18485         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18487         * lread.c: Integer overflow fixes.
18488         (read_integer): Radix is now EMACS_INT, not int,
18489         to improve quality of diagnostics for out-of-range radices.
18490         Calculate buffer size correctly for out-of-range radices.
18491         (read1): Check for integer overflow in radices, and in
18492         read-circle numbers.
18493         (read_escape): Avoid int overflow.
18494         (Fload, openp, read_buffer_size, read1)
18495         (substitute_object_recurse, read_vector, read_list, map_obarray):
18496         Use ptrdiff_t, not int, for sizes.
18497         (read1): Use EMACS_INT, not int, for sizes.
18498         Check for size overflow.
18500         * image.c (cache_image): Check for size arithmetic overflow.
18502         * lread.c: Integer overflow issues.
18503         (saved_doc_string_size, saved_doc_string_length)
18504         (prev_saved_doc_string_size, prev_saved_doc_string_length):
18505         Now ptrdiff_t, not int.
18506         (read1): Don't assume doc string length fits in int.  Check for
18507         out-of-range doc string lengths.
18508         (read_list): Don't assume file position fits in int.
18509         (read_escape): Check for hex character overflow.
18511 2011-06-22  Leo Liu  <sdl.web@gmail.com>
18513         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18514         Move to minibuffer.el.
18516 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
18518         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
18519         The following patches are for when GLYPH_DEBUG && !XASSERT.
18520         * dispextern.h (trace_redisplay_p, dump_glyph_string):
18521         * dispnew.c (flush_stdout):
18522         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18523         Mark as externally visible.
18524         * dispnew.c (check_window_matrix_pointers): Now static.
18525         * dispnew.c (window_to_frame_vpos):
18526         * xfns.c (unwind_create_frame):
18527         * xterm.c (x_check_font): Remove unused local.
18528         * scroll.c (CHECK_BOUNDS):
18529         * xfaces.c (cache_fache): Rename local to avoid shadowing.
18530         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18531         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18532         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18533         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18534         Now static.
18535         (debug_method_add): Use va_list and vsprintf rather than relying
18536         on undefined behavior with wrong number of arguments.
18537         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18538         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18539         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18540         since we're not interested in debugging glyphs with old libraries.
18541         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18542         GCC 4.6.0's static checking.
18544 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
18546         Integer overflow and signedness fixes (Bug#8873).
18547         A few related buffer overrun fixes, too.
18549         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18551         * dispextern.h (struct face.stipple):
18552         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18553         (x_bitmap_mask, x_allocate_bitmap_record)
18554         (x_create_bitmap_from_data, x_create_bitmap_from_file)
18555         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18556         (x_create_bitmap_from_xpm_data):
18557         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18558         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18559         (.bitmaps_last):
18560         * xfaces.c (load_pixmap):
18561         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18562         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18563         (.bitmaps_last, struct x_output.icon_bitmap):
18564         Use ptrdiff_t, not int, for bitmap indexes.
18565         (x_allocate_bitmap_record): Check for size overflow.
18566         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18568         Use ptrdiff_t, not int, for overlay counts.
18569         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18570         * editfns.c (overlays_around, get_pos_property):
18571         * textprop.c (get_char_property_and_overlay):
18572         * xdisp.c (next_overlay_change, note_mouse_highlight):
18573         * xfaces.c (face_at_buffer_position):
18574         * buffer.c (OVERLAY_COUNT_MAX): New macro.
18575         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18576         (Fnext_overlay_change, Fprevious_overlay_change)
18577         (mouse_face_overlay_overlaps, Foverlays_in):
18578         Use ptrdiff_t, not int, for sizes.
18579         (overlays_at, overlays_in): Check for size-calculation overflow.
18581         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18583         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18584         (x_session_initialize): Do not assume string length fits in int.
18586         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18587         This is unlikely, but can occur if DPI is outlandish.
18589         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
18590         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18592         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18593         * xrdb.c (magic_file_p, search_magic_path):
18594         Omit last arg SUFFIX; it was always 0.  All callers changed.
18595         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
18597         * xfont.c (xfont_match): Avoid need for strlen.
18599         * xfns.c: Don't assume strlen fits in int.
18600         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18602         * xdisp.c (message_log_check_duplicate): Return intmax_t,
18603         not unsigned long, as we prefer signed integers.  All callers changed.
18604         Detect integer overflow in repeat count.
18605         (message_dolog): Don't assume print length fits in 39 bytes.
18606         (display_mode_element): Don't assume strlen fits in int.
18608         * termcap.c: Don't assume sizes fit in int and never overflow.
18609         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18610         (gobble_line): Check for size-calculation overflow.
18612         * minibuf.c (Fread_buffer):
18613         * lread.c (intern, intern_c_string):
18614         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18615         Don't assume string length fits in int.
18617         * keyboard.c (parse_tool_bar_item):
18618         * gtkutil.c (style_changed_cb): Avoid need for strlen.
18620         * font.c: Don't assume string length fits in int.
18621         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18622         Use ptrdiff_t, not int.
18623         (font_intern_prop): Don't assume string length fits in int.
18624         Don't assume integer property fits in fixnum.
18625         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
18627         * filelock.c: Fix some buffer overrun and integer overflow issues.
18628         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
18629         Reformulate so as not to need the command string.
18630         Invoke gzip -cd rather than gunzip, as it's more portable.
18631         (lock_info_type, lock_file_1, lock_file):
18632         Don't assume pid_t and time_t fit in unsigned long.
18633         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18634         (current_lock_owner): Prefer signed type for sizes.
18635         Use memcpy, not strncpy, where memcpy is what is really wanted.
18636         Don't assume (via atoi) that time_t and pid_t fit in int.
18637         Check for time_t and/or pid_t out of range, e.g., via a network share.
18638         Don't alloca where an auto var works fine.
18640         * fileio.c: Fix some integer overflow issues.
18641         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18642         Don't assume string length fits in int.
18643         (directory_file_name): Don't assume string length fits in long.
18644         (make_temp_name): Don't assume pid fits in int, or that its print
18645         length is less than 20.
18647         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18649         * coding.c (make_subsidiaries): Don't assume string length fits in int.
18651         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18653         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18654         We prefer signed integers, even for size calculations.
18656         * emacs.c: Don't assume string length fits in 'int'.
18657         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18658         (main): Don't invoke strlen when not needed.
18660         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18661         (XD_DEBUG_MESSAGE): Don't waste a byte.
18663         * callproc.c (getenv_internal_1, getenv_internal)
18664         (Fgetenv_internal):
18665         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18667         * lread.c (invalid_syntax): Omit length argument.
18668         All uses changed.  This doesn't fix a bug, but it simplifies the
18669         code away from its former Hollerith-constant appearance, and it's
18670         one less 'int' to worry about when looking at integer-overflow issues.
18671         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
18673         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18674         This didn't break anything, but it didn't help either.
18675         It's confusing to put a bogus integer in a place where the actual
18676         value does not matter.
18677         (LIST_END_P): Remove unused macro and its bogus comment.
18678         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
18680         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18681         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18682         implementation.
18683         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18684         We prefer signed types, and the value cannot exceed the EMACS_INT
18685         range anyway (because otherwise the length would not be representable).
18686         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18687         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18688         This avoids a GCC warning when WIDE_EMACS_INT.
18690         * indent.c (sane_tab_width): New function.
18691         (current_column, scan_for_column, Findent_to, position_indentation)
18692         (compute_motion): Use it.  This is just for clarity.
18693         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
18695         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
18697         * lisp.h (lint_assume): New macro.
18698         * composite.c (composition_gstring_put_cache):
18699         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18701         * editfns.c, insdel.c:
18702         Omit unnecessary forward decls, to simplify future changes.
18704         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18706         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18708         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
18709         Use much-faster test for byte-length change.
18710         Don't assume string byte-length fits in 'int'.
18711         Check that character arg fits in 'int'.
18712         (mapcar1): Declare byte as byte, for clarity.
18714         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18716         * fns.c (concat): Catch string overflow earlier.
18717         Do not rely on integer wraparound.
18719         * dispextern.h (struct it.overlay_strings_charpos)
18720         (struct it.selective): Now EMACS_INT, not int.
18721         * xdisp.c (forward_to_next_line_start)
18722         (back_to_previous_visible_line_start)
18723         (reseat_at_next_visible_line_start, next_element_from_buffer):
18724         Don't arbitrarily truncate the value of 'selective' to int.
18726         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18728         * composite.c: Don't truncate sizes to 'int'.
18729         (composition_gstring_p, composition_reseat_it)
18730         (composition_adjust_point): Use EMACS_INT, not int.
18731         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18732         not EMACS_UINT, for indexes.
18734         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18736         * buffer.c: Include <verify.h>.
18737         (struct sortvec.priority, struct sortstr.priority):
18738         Now EMACS_INT, not int.
18739         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
18740         (struct sortstr.size, record_overlay_string)
18741         (struct sortstrlist.size, struct sortlist.used):
18742         Don't truncate size to int.
18743         (record_overlay_string): Check for size-calculation overflow.
18744         (init_buffer_once): Check at compile-time, not run-time.
18746 2011-06-22  Jim Meyering  <meyering@redhat.com>
18748         Don't leak an XBM-image-sized buffer
18749         * image.c (xbm_load): Free the image buffer after using it.
18751 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
18753         Port to Sun C.
18754         * composite.c (find_automatic_composition): Omit needless 'return 0;'
18755         that Sun C diagnosed.
18756         * fns.c (secure_hash): Fix pointer signedness issue.
18757         * intervals.c (static_offset_intervals): New function.
18758         (offset_intervals): Use it.
18760 2011-06-21  Leo Liu  <sdl.web@gmail.com>
18762         * deps.mk (fns.o):
18763         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18764         sha512.h.
18766         * fns.c (secure_hash): Rename from crypto_hash_function and change
18767         the first arg to accept symbols.
18768         (Fsecure_hash): New primitive.
18769         (syms_of_fns): New symbols.
18771 2011-06-20  Deniz Dogan  <deniz@dogan.se>
18773         * process.c (Fset_process_buffer): Clarify return value in
18774         docstring.
18776 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
18778         * dispnew.c (add_window_display_history): Use BVAR.
18780         * xdisp.c (debug_method_add): Use BVAR.
18781         (check_window_end, dump_glyph_matrix, dump_glyph)
18782         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18784         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18785         Likewise.
18787         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18788         check till after the cache is created in init_frame_faces.
18790 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
18792         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18794 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
18796         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18797         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18798         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18800         Improve buffer-overflow checking (Bug#8873).
18801         * fileio.c (Finsert_file_contents):
18802         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18803         Remove the old (too-loose) buffer overflow checks.
18804         They weren't needed, since make_gap checks for buffer overflow.
18805         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18806         The old code merely checked for Emacs fixnum overflow, and relied
18807         on undefined (wraparound) behavior.  The new code avoids undefined
18808         behavior, and also checks for ptrdiff_t and/or size_t overflow.
18810         * editfns.c (Finsert_char): Don't dump core with very negative counts.
18811         Tune.  Don't use wider integers than needed.  Don't use alloca.
18812         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
18814         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18816         * insdel.c, lisp.h (buffer_overflow): New function.
18817         (insert_from_buffer_1, replace_range, replace_range_2):
18818         * insdel.c (make_gap_larger):
18819         * editfns.c (Finsert_char):
18820         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18822         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18824 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
18826         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
18828         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18829         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18831         * fileio.c: Don't assume EMACS_INT fits in off_t.
18832         (emacs_lseek): New static function.
18833         (Finsert_file_contents, Fwrite_region): Use it.
18834         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18836         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18838         * fns.c: Don't overflow int when computing a list length.
18839         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18840         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18841         truncation on 64-bit hosts.  Check for QUIT every
18842         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18843         faster and is responsive enough.
18844         (Flength): Report an error instead of overflowing an integer.
18845         (Fsafe_length): Return a float if the value is not representable
18846         as a fixnum.  This shouldn't happen except in contrived situations.
18847         (Fnthcdr, Fsort): Don't assume list length fits in int.
18848         (Fcopy_sequence): Don't assume vector length fits in int.
18850         * alloc.c: Check that resized vectors' lengths fit in fixnums.
18851         (header_size, word_size): New constants.
18852         (allocate_vectorlike): Don't check size overflow here.
18853         (allocate_vector): Check it here instead, since this is the only
18854         caller of allocate_vectorlike that could cause overflow.
18855         Check that the new vector's length is representable as a fixnum.
18857         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18858         The previous code was bogus.  For example, next_almost_prime (32)
18859         returned 39, which is undesirable as it is a multiple of 3; and
18860         next_almost_prime (24) returned 25, which is a multiple of 5 so
18861         why was the code bothering to check for multiples of 7?
18863         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18865         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18867         Variadic C functions now count arguments with ptrdiff_t.
18868         This partly undoes my 2011-03-30 change, which replaced int with size_t.
18869         Back then I didn't know that the Emacs coding style prefers signed int.
18870         Also, in the meantime I found a few more instances where arguments
18871         were being counted with int, which may truncate counts on 64-bit
18872         machines, or EMACS_INT, which may be unnecessarily wide.
18873         * lisp.h (struct Lisp_Subr.function.aMANY)
18874         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18875         Arg counts are now ptrdiff_t, not size_t.
18876         All variadic functions and their callers changed accordingly.
18877         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
18878         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18879         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
18880         * callint.c (Fcall_interactively): Check arg count for overflow,
18881         to avoid potential buffer overrun.  Use signed char, not 'int',
18882         for 'varies' array, so that we needn't bother to check its size
18883         calculation for overflow.
18884         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18885         * eval.c (apply_lambda):
18886         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18887         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
18888         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18890         * callint.c (Fcall_interactively): Don't use index var as event count.
18892         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18893         * mem-limits.h (SIZE): Remove; no longer used.
18895         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
18897         Remove unnecessary casts.
18898         * xterm.c (x_term_init):
18899         * xfns.c (x_set_border_pixel):
18900         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18901         These aren't needed now that we assume ANSI C.
18903         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18904         It's more likely to cause problems (due to unsigned overflow)
18905         than to cure them.
18907         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18909         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18911         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18913         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18915         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18917         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18919         GLYPH_CODE_FACE returns EMACS_INT, not int.
18920         * dispextern.h (merge_faces):
18921         * xfaces.c (merge_faces):
18922         * xdisp.c (get_next_display_element, next_element_from_display_vector):
18923         Don't assume EMACS_INT fits in int.
18925         * character.h (CHAR_VALID_P): Remove unused parameter.
18926         * fontset.c, lisp.h, xdisp.c: All uses changed.
18928         * editfns.c (Ftranslate_region_internal): Omit redundant test.
18930         * fns.c (concat): Minor tuning based on overflow analysis.
18931         This doesn't fix any bugs.  Use int to hold character, instead
18932         of constantly refetching from Emacs object.  Use XFASTINT, not
18933         XINT, for value known to be a character.  Don't bother comparing
18934         a single byte to 0400, as it's always less.
18936         * floatfns.c (Fexpt):
18937         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18939         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18940         for characters.
18942         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18944         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18945         Without this fix, on a 64-bit host (aset S 0 4294967386) would
18946         incorrectly succeed when S was a string, because 4294967386 was
18947         truncated before it was used.
18949         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18950         Otherwise, an out-of-range integer could cause undefined behavior
18951         on a 64-bit host.
18953         * composite.c: Use int, not EMACS_INT, for characters.
18954         (fill_gstring_body, composition_compute_stop_pos): Use int, not
18955         EMACS_INT, for values that are known to be in character range.
18956         This doesn't fix any bugs but is the usual style inside Emacs and
18957         may generate better code on 32-bit machines.
18959         Make sure a 64-bit char is never passed to ENCODE_CHAR.
18960         This is for reasons similar to the recent CHAR_STRING fix.
18961         * charset.c (Fencode_char): Check that character arg is actually
18962         a character.  Pass an int to ENCODE_CHAR.
18963         * charset.h (ENCODE_CHAR): Verify that the character argument is no
18964         wider than 'int', as a compile-time check to prevent future regressions
18965         in this area.
18967         * character.c (char_string): Remove unnecessary casts.
18969         Make sure a 64-bit char is never passed to CHAR_STRING.
18970         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18971         by silently ignoring the top 32 bits, allowing some values
18972         that were far too large to be valid characters.
18973         * character.h: Include <verify.h>.
18974         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18975         arguments are no wider than unsigned, as a compile-time check
18976         to prevent future regressions in this area.
18977         * data.c (Faset):
18978         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
18979         (Fsubst_char_in_region):
18980         * fns.c (concat):
18981         * xdisp.c (decode_mode_spec_coding):
18982         Adjust to CHAR_STRING's new requirement.
18983         * editfns.c (Finsert_char, Fsubst_char_in_region):
18984         * fns.c (concat): Check that character args are actually
18985         characters.  Without this test, these functions did the wrong
18986         thing with wildly out-of-range values on 64-bit hosts.
18988         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18989         These casts should not be needed on 32-bit hosts, either.
18990         * keyboard.c (read_char):
18991         * lread.c (Fload): Remove casts to unsigned.
18993         * lisp.h (UNSIGNED_CMP): New macro.
18994         This fixes comparison bugs on 64-bit hosts.
18995         (ASCII_CHAR_P): Use it.
18996         * casefiddle.c (casify_object):
18997         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
18998         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18999         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19000         * dispextern.h (FACE_FROM_ID):
19001         * keyboard.c (read_char): Use UNSIGNED_CMP.
19003         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19004         not to EMACS_INT, to avoid GCC warning.
19006         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19008         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19009         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19010         isn't needed on 32-bit machines.
19012         * buffer.c (Fgenerate_new_buffer_name):
19013         Use EMACS_INT for count, not int.
19014         (advance_to_char_boundary): Return EMACS_INT, not int.
19016         * data.c (Qcompiled_function): Now static.
19018         * window.c (window_body_lines): Now static.
19020         * image.c (gif_load): Rename local to avoid shadowing.
19022         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19023         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19024         * alloc.c (make_save_value): Integer argument is now of type
19025         ptrdiff_t, not int.
19026         (mark_object): Use ptrdiff_t, not int.
19027         * lisp.h (pD): New macro.
19028         * print.c (print_object): Use it.
19030         * alloc.c: Use EMACS_INT, not int, to count objects.
19031         (total_conses, total_markers, total_symbols, total_vector_size)
19032         (total_free_conses, total_free_markers, total_free_symbols)
19033         (total_free_floats, total_floats, total_free_intervals)
19034         (total_intervals, total_strings, total_free_strings):
19035         Now EMACS_INT, not int.  All uses changed.
19036         (Fgarbage_collect): Compute overall total using a double, so that
19037         integer overflow is less likely to be a problem.  Check for overflow
19038         when converting back to an integer.
19039         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19040         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19041         These were 'int' variables that could overflow on 64-bit hosts;
19042         they were never used, so remove them instead of repairing them.
19043         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
19044         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19045         Previously, this ceilinged at INT_MAX, but that doesn't work on
19046         64-bit machines.
19047         (allocate_pseudovector): Don't use EMACS_INT when int would do.
19049         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
19050         (allocate_vectorlike): Check for ptrdiff_t overflow.
19051         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19052         when a (possibly-narrower) signed value would do just as well.
19053         We prefer using signed arithmetic, to avoid comparison confusion.
19055         * alloc.c: Catch some string size overflows that we were missing.
19056         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19057         for convenience in STRING_BYTES_MAX.
19058         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19059         The definition here is exact; the one in lisp.h was approximate.
19060         (allocate_string_data): Check for string overflow.  This catches
19061         some instances we weren't catching before.  Also, it catches
19062         size_t overflow on (unusual) hosts where SIZE_MAX <= min
19063         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19064         and ptrdiff_t and EMACS_INT are both 64 bits.
19066         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19067         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
19068         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
19070         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19072         * alloc.c (Fmake_string): Check for out-of-range init.
19074 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
19076         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19078 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
19080         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19081         xg_get_default_scrollbar_width.
19083         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19084         (int_gtk_range_get_value): Move to the scroll bar part of the file.
19085         (style_changed_cb): Call update_theme_scrollbar_width and call
19086         x_set_scroll_bar_default_width and xg_frame_set_char_size for
19087         all frames (Bug#8505).
19088         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19089         Call gtk_window_set_resizable if HAVE_GTK3.
19090         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19091         and height if HAVE_GTK3 (Bug#8505).
19092         (scroll_bar_width_for_theme): New variable.
19093         (update_theme_scrollbar_width): New function.
19094         (xg_get_default_scrollbar_width): Move code to
19095         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19096         (xg_initialize): Call update_theme_scrollbar_width.
19098         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19100         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19102 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
19104         * frame.c (make_frame): Call other_buffer_safely instead of
19105         other_buffer.
19107         * window.c (temp_output_buffer_show): Call display_buffer with
19108         second argument Vtemp_buffer_show_specifiers and reset latter
19109         immediately after the call.
19110         (Vtemp_buffer_show_specifiers): New variable.
19111         (auto_window_vscroll_p, next_screen_context_lines)
19112         (Vscroll_preserve_screen_position): Remove leading asterisks from
19113         doc-strings.
19115 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
19117         Fix minor problems found by GCC 4.6.0 static checking.
19118         * buffer.c (Qclone_number): Remove for now, as it's unused.
19119         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19120         (record_buffer): Remove unused local.
19121         * frame.c (other_visible_frames, frame_buffer_list): Now static.
19122         (set_frame_buffer_list): Remove; unused.
19123         * frame.h (other_visible_frames): Remove decl.
19124         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19125         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19126         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19127         if HAVE_GPM.
19128         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19129         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19130         Define only if HAVE_GPM.
19131         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19132         (update_hints_inhibit): Remove; never set.  All uses removed.
19133         * widgetprv.h (emacsFrameClassRec): Remove decl.
19134         * window.c (delete_deletable_window): Now returns void, since it
19135         wasn't returning anything.
19136         (compare_window_configurations): Remove unused locals.
19137         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19138         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
19139         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19140         the same widths as pointers.  This follows up on the 2011-05-06 patch.
19141         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19142         * xterm.h: Likewise.
19143         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19145 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
19147         * makefile.w32-in: Update dependencies.
19148         (LISP_H): Add lib/intprops.h.
19150 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
19152         * image.c (gif_load): Add animation frame delay to the metadata.
19153         (syms_of_image): Use DEFSYM.  New symbol `delay'.
19155 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
19157         * window.c (delete_deletable_window): Re-add.
19158         (Fset_window_configuration): Rewrite to handle dead buffers and
19159         consequently deletable windows.
19160         (window_tree, Fwindow_tree): Remove.  Supply functionality in
19161         window.el.
19162         (compare_window_configurations): Simplify code.
19164 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
19166         * image.c (imagemagick_load_image): Fix type mismatch.
19167         (Fimagemagick_types): Likewise.
19169         * window.h (replace_buffer_in_windows): Declare.
19171 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
19173         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19174         Qclone_number.  Remove external declaration of Qdelete_window.
19175         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
19176         code.
19177         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19178         Run Qbuffer_list_update_hook if allowed.
19179         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
19180         buffer list implementation.
19181         (other_buffer_safely): New function.
19182         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19183         calls to replace_buffer_in_windows and
19184         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
19185         if allowed.
19186         (record_buffer): Inhibit quitting and rewrite using quittable
19187         functions.  Run Qbuffer_list_update_hook if allowed.
19188         (Frecord_buffer, Funrecord_buffer): New functions.
19189         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19190         Move switch-to-buffer to window.el.
19191         (bury-buffer): Move to window.el.
19192         (Vbuffer_list_update_hook): New variable.
19194         * lisp.h (other_buffer_safely): Add prototype in buffer.c
19195         section.
19197         * window.h (resize_frame_windows): Move up in code.
19198         (Fwindow_frame): Remove EXFUN.
19199         (replace_buffer_in_all_windows): Remove prototype.
19200         (replace_buffer_in_windows_safely): Add prototype.
19202         * window.c: Declare Qdelete_window static again.  Move down
19203         declaration of select_count.
19204         (Fnext_window, Fprevious_window): Rewrite doc-strings.
19205         (Fother_window): Move to window.el.
19206         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19207         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19208         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19209         window.el.
19210         (replace_buffer_in_windows): Implement by calling
19211         Qreplace_buffer_in_windows.
19212         (replace_buffer_in_all_windows): Remove with some functionality
19213         moved into replace_buffer_in_windows_safely.
19214         (replace_buffer_in_windows_safely): New function.
19215         (select_window_norecord, select_frame_norecord): Move in front
19216         of run_window_configuration_change_hook.  Remove now obsolete
19217         declarations.
19218         (Fset_window_buffer): Rewrite doc-string.
19219         Call Qrecord_window_buffer.
19220         (keys_of_window): Move binding for other-window to window.el.
19222 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
19224         * dispextern.h (struct image): Replace data member, whose int_val
19225         and ptr_val fields were not used by anything, with a single
19226         lisp_val object.
19228         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19229         (gif_clear_image, gif_load, imagemagick_load_image)
19230         (gs_clear_image, gs_load): Callers changed.
19232 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
19234         * buffer.h: Include <time.h>, for time_t.
19235         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
19237         Fix minor problems found by static checking.
19239         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19241         Make identifiers static if they are not used in other modules.
19242         * data.c (Qcompiled_function, Qframe, Qvector):
19243         * image.c (QimageMagick, Qsvg):
19244         * minibuf.c (Qmetadata):
19245         * window.c (resize_window_check, resize_root_window): Now static.
19246         * window.h (resize_window_check, resize_root_window): Remove decls.
19248         * window.c (window_deletion_count, delete_deletable_window):
19249         Remove; unused.
19250         (window_body_lines): Now static.
19251         (Fdelete_other_windows_internal): Mark vars as initialized.
19252         Make sure 'resize_failed' is initialized.
19253         (run_window_configuration_change_hook): Rename local to avoid shadowing.
19254         (resize_window_apply): Remove unused local.
19255         * window.h (delete_deletable_window): Remove decl.
19257         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
19258         (imagemagick_load_image): Fix pointer signedness problem by changing
19259         last arg from unsigned char * to char *.  All uses changed.
19260         Also, fix a local for similar reasons.
19261         Remove unused locals.  Remove locals to avoid shadowing.
19262         (fn_rsvg_handle_free): Remove; unused.
19263         (svg_load, svg_load_image): Fix pointer signedness problem.
19264         (imagemagick_load_image): Don't use garbage pointer image_wand.
19266         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19268 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
19270         * image.c (gif_load): Fix omitted cast error introduced by
19271         2011-06-06 change.
19273 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
19275         * window.h (resize_proportionally, orig_total_lines)
19276         (orig_top_line): Remove from window structure.
19277         (set_window_height, set_window_width, change_window_heights)
19278         (Fdelete_window): Remove prototypes.
19279         (resize_frame_windows): Remove duplicate declaration.
19281 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
19283         * window.h (resize_frame_windows, resize_window_check)
19284         (delete_deletable_window, resize_root_window)
19285         (resize_frame_windows): Declare prototypes.
19287         * window.c (resize_window_apply): Make definition be "static" to
19288         match the prototype.
19290 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
19292         * window.c: Remove declarations of Qwindow_size_fixed,
19293         window_min_size_1, window_min_size_2, window_min_size,
19294         size_window, window_fixed_size_p, enlarge_window, delete_window.
19295         Remove static from declaration of Qdelete_window, it's
19296         temporarily needed by Fbury_buffer.
19297         (replace_window): Don't assign orig_top_line and
19298         orig_total_lines.
19299         (Fdelete_window, delete_window): Remove.  Window deletion is
19300         handled by window.el.
19301         (window_loop): Remove DELETE_OTHER_WINDOWS case.
19302         Replace Fdelete_window calls with calls to Qdelete_window.
19303         (Fdelete_other_windows): Remove.  Deleting other windows is
19304         handled by window.el.
19305         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
19306         handled in window.el.
19307         (window_min_size_2, window_min_size_1, window_min_size): Remove.
19308         Window minimum sizes are handled in window.el.
19309         (shrink_windows, size_window, set_window_height)
19310         (set_window_width, change_window_heights, window_height)
19311         (window_width, CURBEG, CURSIZE, enlarge_window)
19312         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19313         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
19314         handled in window.el.
19315         (make_dummy_parent): Rename to make_parent_window and give it a
19316         second argument horflag.
19317         (make_window): Don't set resize_proportionally any more.
19318         (Fsplit_window): Remove.  Windows are split in window.el.
19319         (save_restore_action, save_restore_orig_size)
19320         (shrink_window_lowest_first, save_restore_orig_size): Remove.
19321         Resize mini windows in window.el.
19322         (grow_mini_window, shrink_mini_window): Implement by calling
19323         Qresize_root_window_vertically, resize_window_check and
19324         resize_window_apply.
19325         (saved_window, Fset_window_configuration, save_window_save):
19326         Do not handle orig_top_line, orig_total_lines, and
19327         resize_proportionally.
19328         (window_min_height, window_min_width): Move to window.el.
19329         (keys_of_window): Move bindings for delete-other-windows,
19330         split-window, delete-window and enlarge-window to window.el.
19332         * buffer.c: Temporarily extern Qdelete_window.
19333         (Fbury_buffer): Temporarily call Qdelete_window instead of
19334         Fdelete_window (Fbury_buffer will move to window.el soon).
19336         * frame.c (set_menu_bar_lines_1): Remove code handling
19337         orig_top_line and orig_total_lines.
19339         * dispnew.c (adjust_frame_glyphs_initially): Don't use
19340         set_window_height but set heights directly.
19341         (change_frame_size_1): Use resize_frame_windows.
19343         * xdisp.c (init_xdisp): Don't use set_window_height but set
19344         heights directly.
19346         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19347         Use resize_frame_windows instead of change_window_heights and run
19348         run_window_configuration_change_hook.
19350         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19351         instead of change_window_heights and run
19352         run_window_configuration_change_hook.
19354 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
19356         * window.c (replace_window): Rename second argument REPLACEMENT to
19357         NEW.  New third argument SETFLAG.  Rewrite.
19358         (delete_window, make_dummy_parent): Call replace_window with
19359         third argument 1.
19360         (window_list_1): Move down in code.
19361         (run_window_configuration_change_hook): Move set_buffer part
19362         before select_frame_norecord part in order to unwind correctly.
19363         Rename count1 to count.
19364         (recombine_windows, delete_deletable_window, resize_root_window)
19365         (Fdelete_other_windows_internal)
19366         (Frun_window_configuration_change_hook, make_parent_window)
19367         (resize_window_check, resize_window_apply, Fresize_window_apply)
19368         (resize_frame_windows, Fsplit_window_internal)
19369         (Fdelete_window_internal, Fresize_mini_window_internal):
19370         New functions.
19371         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19373 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
19375         * window.h (window): Add some new members to window structure -
19376         normal_lines, normal_cols, new_total, new_normal, clone_number,
19377         splits, nest, prev_buffers, next_buffers.
19378         (WINDOW_TOTAL_SIZE): Move here from window.c.
19379         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
19381         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19382         Remove.
19383         (make_dummy_parent): Set new members of windows structure.
19384         (make_window): Move down in code.  Handle new members of window
19385         structure.
19386         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19387         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19388         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19389         (Fset_window_prev_buffers, Fwindow_next_buffers)
19390         (Fset_window_next_buffers, Fset_window_clone_number):
19391         New functions.
19392         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19393         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19394         Doc-string fixes.
19395         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19396         Argument WINDOW can be now internal window too.
19397         (Fwindow_use_time): Move up in code.
19398         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19399         Rewrite doc-string.
19400         (Fset_window_configuration, saved_window)
19401         (Fcurrent_window_configuration, save_window_save): Handle new
19402         members of window structure.
19403         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19404         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19405         (syms_of_window): New Lisp objects Qrecord_window_buffer,
19406         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19407         Qget_mru_window, Qresize_root_window,
19408         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19409         Qauto_buffer_name; staticpro them.
19411 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
19413         * window.c (Fwindow_total_size, Fwindow_left_column)
19414         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19415         (Fwindow_list_1): New functions.
19416         (window_box_text_cols): Replace with window_body_cols.
19417         (Fwindow_width, Fscroll_left, Fscroll_right):
19418         Use window_body_cols instead of window_box_text_cols.
19419         (delete_window, Fset_window_configuration):
19420         Call delete_all_subwindows with window as argument.
19421         (delete_all_subwindows): Take a window as argument and not a
19422         structure.  Rewrite.
19423         (window_loop): Remove handling of GET_LRU_WINDOW and
19424         GET_LARGEST_WINDOW.
19425         (Fget_lru_window, Fget_largest_window): Move to window.el.
19427         * window.h: Extern window_body_cols instead of
19428         window_box_text_cols.  delete_all_subwindows now takes a
19429         Lisp_Object as argument.
19431         * indent.c (compute_motion, Fcompute_motion):
19432         Use window_body_cols instead of window_box_text_cols.
19434         * frame.c (delete_frame): Call delete_all_subwindows with root
19435         window as argument.
19437 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
19439         * fns.c (Fputhash): Document return value.
19441 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
19443         * image.c (gif_load): Implement gif89a spec "no disposal" method.
19445 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
19447         Cons<->int and similar integer overflow fixes (Bug#8794).
19449         Check for overflow when converting integer to cons and back.
19450         * charset.c (Fdefine_charset_internal, Fdecode_char):
19451         Use cons_to_unsigned to catch overflow.
19452         (Fencode_char): Use INTEGER_TO_CONS.
19453         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19454         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19455         * data.c (long_to_cons, cons_to_long): Remove.
19456         (cons_to_unsigned, cons_to_signed): New functions.
19457         These signal an error for invalid or out-of-range values.
19458         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19459         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19460         * font.c (Ffont_variation_glyphs):
19461         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19462         * lisp.h: Include <intprops.h>.
19463         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19464         (cons_to_signed, cons_to_unsigned): New decls.
19465         (long_to_cons, cons_to_long): Remove decls.
19466         * undo.c (record_first_change): Use INTEGER_TO_CONS.
19467         (Fprimitive_undo): Use CONS_TO_INTEGER.
19468         * xfns.c (Fx_window_property): Likewise.
19469         * xselect.c: Include <limits.h>.
19470         (x_own_selection, selection_data_to_lisp_data):
19471         Use INTEGER_TO_CONS.
19472         (x_handle_selection_request, x_handle_selection_clear)
19473         (x_get_foreign_selection, Fx_disown_selection_internal)
19474         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19475         (lisp_data_to_selection_data): Use cons_to_unsigned.
19476         (x_fill_property_data): Use cons_to_signed.
19477         Report values out of range.
19479         Check for buffer and string overflow more precisely.
19480         * buffer.h (BUF_BYTES_MAX): New macro.
19481         * lisp.h (STRING_BYTES_MAX): New macro.
19482         * alloc.c (Fmake_string):
19483         * character.c (string_escape_byte8):
19484         * coding.c (coding_alloc_by_realloc):
19485         * doprnt.c (doprnt):
19486         * editfns.c (Fformat):
19487         * eval.c (verror):
19488         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19489         since they may not be the same number.
19490         * editfns.c (Finsert_char):
19491         * fileio.c (Finsert_file_contents):
19492         Likewise for BUF_BYTES_MAX.
19494         * image.c: Use ptrdiff_t, not int, for sizes.
19495         (slurp_file): Switch from int to ptrdiff_t.
19496         All uses changed.
19497         (slurp_file): Check that file size fits in both size_t (for
19498         malloc) and ptrdiff_t (for sanity and safety).
19500         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19501         if b->modtime has its maximal value.
19503         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19505         Don't assume time_t can fit into int.
19506         * buffer.h (struct buffer.modtime): Now time_t, not int.
19507         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19508         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19510         Minor fixes for signed vs unsigned integers.
19511         * character.h (MAYBE_UNIFY_CHAR):
19512         * charset.c (maybe_unify_char):
19513         * keyboard.c (read_char, reorder_modifiers):
19514         XINT -> XFASTINT, since the integer must be nonnegative.
19515         * ftfont.c (ftfont_spec_pattern):
19516         * keymap.c (access_keymap, silly_event_symbol_error):
19517         XUINT -> XFASTINT, since the integer must be nonnegative.
19518         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19519         since it makes no difference and we prefer signed.
19520         * keyboard.c (record_char): Use XUINT when all the neighbors do.
19521         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19522         nonnegative.
19524 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
19526         * window.h (Fwindow_frame): Declare.
19528 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
19530         * alloc.c: Simplify handling of large-request failures (Bug#8800).
19531         (SPARE_MEMORY): Always define.
19532         (LARGE_REQUEST): Remove.
19533         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19535 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
19537         * lisp.h: Move EXFUNS for Fframe_root_window,
19538         Fframe_first_window and Fset_frame_selected_window to window.h.
19540         * window.h: Move EXFUNS for Fframe_root_window,
19541         Fframe_first_window and Fset_frame_selected_window here from
19542         lisp.h.
19544         * frame.c (Fwindow_frame, Fframe_first_window)
19545         (Fframe_root_window, Fframe_selected_window)
19546         (Fset_frame_selected_window): Move to window.c.
19547         (Factive_minibuffer_window): Move to minibuf.c.
19548         (Fother_visible_frames_p): New function.
19550         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19552         * window.c (decode_window, decode_any_window): Move up in code.
19553         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19554         (inhibit_frame_unsplittable): Remove unused variable.
19555         (Fwindow_buffer): Move up and rewrite doc-string.
19556         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19557         (Fwindow_prev): New functions.
19558         (Fwindow_frame): Move here from frame.c.  Accept any window as
19559         argument.
19560         (Fframe_root_window, Fframe_first_window)
19561         (Fframe_selected_window): Move here from frame.c.  Accept frame
19562         or arbitrary window as argument.  Update doc-strings.
19563         (Fminibuffer_window): Move up in code.
19564         (Fwindow_minibuffer_p): Move up in code and simplify.
19565         (Fset_frame_selected_window): Move here from frame.c.
19566         Marginal rewrite.
19567         (Fselected_window, select_window, Fselect_window): Move up in
19568         code.  Minor doc-string fixes.
19570 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
19572         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19573         Do not assume that spare memory exists; that assumption is valid
19574         only if SYSTEM_MALLOC.
19575         (LARGE_REQUEST): New macro, so that the issue of large requests
19576         is separated from the issue of spare memory.
19578 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
19580         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19581         format.  (Bug#8806)
19583         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19585         * xfns.c (x_set_scroll_bar_default_width): Move declarations
19586         before statements.
19588 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
19590         * gtkutil.c (xg_get_default_scrollbar_width): New function.
19592         * gtkutil.h: Declare xg_get_default_scrollbar_width.
19594         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19595         min width by calling x_set_scroll_bar_default_width (Bug#8505).
19597 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
19599         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19601 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
19603         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19604         (x_clipboard_manager_save): Add return value.
19605         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19606         New error handlers.
19607         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19608         Obey Vx_select_enable_clipboard_manager.  Catch errors in
19609         x_clipboard_manager_save (Bug#8779).
19610         (Vx_select_enable_clipboard_manager): New variable.
19611         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
19613 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
19615         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19617 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
19619         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19620         in the current matrix if keep_current_p is non-zero.
19622 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
19624         * bidi.c (bidi_level_of_next_char): Fix last change.
19626 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
19628         Support bidi reordering of text covered by display properties.
19630         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19631         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19632         (bidi_cache_search, bidi_cache_iterator_state)
19633         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
19634         (bidi_level_of_next_char, bidi_move_to_visually_next):
19635         Support character positions inside a run of characters covered by a
19636         display string.
19637         (bidi_paragraph_init, bidi_resolve_explicit_1)
19638         (bidi_level_of_next_char): Call bidi_fetch_char and
19639         bidi_fetch_char_advance instead of FETCH_CHAR and
19640         FETCH_CHAR_ADVANCE.
19641         (bidi_init_it): Initialize new members.
19642         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19643         definitions.
19644         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19645         instead of using explicit *_CHAR codes.
19646         (bidi_resolve_explicit, bidi_resolve_weak):
19647         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
19648         bidirectional text is supported only in multibyte buffers.
19649         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19650         it to initialize the frame_window_p member of struct bidi_it.
19651         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19652         (bidi_resolve_explicit, bidi_resolve_weak)
19653         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19654         bidi_it->nchars is non-positive.
19655         (bidi_level_of_next_char): Don't try to lookup the cache for the
19656         next/previous character if nothing is cached there yet, or if we
19657         were just reseat()'ed to a new position.
19659         * xdisp.c (set_cursor_from_row): Set start and stop points
19660         according to the row's direction when priming the loop that looks
19661         for the glyph on which to display cursor.
19662         (single_display_spec_intangible_p): Function deleted.
19663         (display_prop_intangible_p): Reimplement to call
19664         handle_display_spec instead of single_display_spec_intangible_p.
19665         Accept 3 additional arguments needed by handle_display_spec.
19666         This fixes incorrect cursor motion across display property with complex
19667         values: lists, `(when COND...)' forms, etc.
19668         (single_display_spec_string_p): Support property values that are
19669         lists with the argument STRING its top-level element.
19670         (display_prop_string_p): Fix the condition for processing a
19671         property that is a list to be consistent with handle_display_spec.
19672         (handle_display_spec): New function, refactored from the
19673         last portion of handle_display_prop.
19674         (compute_display_string_pos): Accept additional argument
19675         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
19676         value of a `display' property is a "replacing spec".
19677         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19678         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
19679         the display property, but just return a value indicating whether
19680         the display property will replace the characters it covers.
19681         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19682         frame_window_p members of struct bidi_it.
19683         (compute_display_string_pos, compute_display_string_end):
19684         New functions.
19685         (push_it): Accept second argument POSITION, where pop_it should
19686         jump to continue iteration.
19687         (reseat_1): Initialize bidi_it.disp_pos.
19689         * keyboard.c (adjust_point_for_property): Adjust the call to
19690         display_prop_intangible_p to its new signature.
19692         * dispextern.h (struct bidi_it): New member frame_window_p.
19693         (bidi_init_it): Update prototypes.
19694         (display_prop_intangible_p): Update prototype.
19695         (compute_display_string_pos, compute_display_string_end):
19696         Declare prototypes.
19697         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
19698         EMACS_INT.
19700 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
19702         Malloc failure behavior now depends on size of allocation.
19703         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19704         * lisp.h: Change signatures accordingly.
19705         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19706         All callers changed.  (Bug#8762)
19708         * gnutls.c: Use Emacs's memory allocators.
19709         Without this change, the gnutls library would invoke malloc etc.
19710         directly, which causes problems on non-SYNC_INPUT hosts, and which
19711         runs afoul of improving memory_full behavior.  (Bug#8761)
19712         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19713         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19714         xfree instead of the default malloc, realloc, free.
19715         (Fgnutls_boot): No need to check for memory allocation failure,
19716         since xmalloc does that for us.
19718         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
19719         * category.c (hash_get_category_set):
19720         * ccl.c (ccl_driver):
19721         * charset.c (Fdefine_charset_internal):
19722         * charset.h (struct charset.hash_index):
19723         * composite.c (get_composition_id, gstring_lookup_cache)
19724         (composition_gstring_put_cache):
19725         * composite.h (struct composition.hash_index):
19726         * dispextern.h (struct image.hash):
19727         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19728         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19729         (hashfn_equal, hashfn_user_defined, make_hash_table)
19730         (maybe_resize_hash_table, hash_lookup, hash_put)
19731         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19732         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19733         (Fsxhash, Fgethash, Fputhash, Fmaphash):
19734         * image.c (make_image, search_image_cache, lookup_image)
19735         (xpm_put_color_table_h):
19736         * lisp.h (struct Lisp_Hash_Table):
19737         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
19738         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
19739         for hashes and hash indexes, instead of 'unsigned' and 'int'.
19740         * alloc.c (allocate_vectorlike):
19741         Check for overflow in vector size calculations.
19742         * ccl.c (ccl_driver):
19743         Check for overflow when converting EMACS_INT to int.
19744         * fns.c, image.c: Remove unnecessary static decls that would otherwise
19745         need to be updated by these changes.
19746         * fns.c (make_hash_table, maybe_resize_hash_table):
19747         Check for integer overflow with large hash tables.
19748         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19749         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19750         (SXHASH_REDUCE): New macro.
19751         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19752         Use it instead of discarding useful hash info with large hash values.
19753         (sxhash_float): New function.
19754         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
19755         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
19756         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19757         Rewrite to use FIXNUM_BITS, as this simplifies things.
19758         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19759         Adjust signatures to match updated version of code.
19760         (consing_since_gc): Now EMACS_INT, since a single hash table can
19761         use more than INT_MAX bytes.
19763 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
19765         Make it possible to build with GCC-4.6+ -O2 -flto.
19767         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19769 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
19771         * minibuf.c (get_minibuffer, read_minibuf_unwind):
19772         Call minibuffer-inactive-mode.
19774 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
19776         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19777         Update dependencies.
19779 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
19781         * data.c (init_data): Remove code for UTS, this system is not
19782         supported anymore.
19784 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
19786         Don't force ./temacs to start in terminal mode.
19788         * frame.c (make_initial_frame): Initialize faces in all cases, not
19789         only when CANNOT_DUMP is defined.
19790         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19792 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
19794         * dispnew.c (add_window_display_history): Use const for the string
19795         pointer.  Remove declaration, not needed.
19797 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
19799         Use 'inline', not 'INLINE'.
19800         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
19801         * alloc.c, fontset.c (INLINE): Remove.
19802         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19803         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19804         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19805         * gmalloc.c (register_heapinfo): Use inline unconditionally.
19806         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19808 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
19810         Make it possible to run ./temacs.
19812         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19813         syms_of_callproc does the same thing.  Remove test for
19814         "initialized", do it in the caller.
19815         * emacs.c (main): Avoid calling set_initial_environment when dumping.
19817 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
19819         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19820         (read_minibuf): Use get_minibuffer.
19821         (syms_of_minibuf): Use DEFSYM.
19822         (Qmetadata): New var.
19823         * data.c (Qbuffer): Don't make it static.
19824         (syms_of_data): Use DEFSYM.
19826 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
19828         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
19829         (CCL_CODE_MIN): New macro.
19831 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
19833         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19835         * eval.c (Qdebug): Now static.
19836         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
19837         2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19838         2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19840 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
19842         * image.c: Various fixes to ImageMagick code comments.
19843         (Fimagemagick_types): Doc fix.
19845 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
19847         Minor fixes prompted by GCC 4.6.0 warnings.
19849         * xselect.c (converted_selections, conversion_fail_tag): Now static.
19851         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19852         (x_clipboard_manager_save_all): Move extern decl to ...
19853         * xterm.h: ... here, so that it can be checked for consistency.
19855 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
19857         * xselect.c (x_clipboard_manager_save_frame)
19858         (x_clipboard_manager_save_all): New functions.
19859         (Fx_clipboard_manager_save): Lisp function deleted.
19861         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19862         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19864         * xterm.h: Update prototype.
19866 2011-05-28  William Xu  <william.xwl@gmail.com>
19868         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19869         exiting (Bug#8239).
19871 2011-05-28  Jim Meyering  <meyering@redhat.com>
19873         Avoid a sign-extension bug in crypto_hash_function.
19874         * fns.c (to_uchar): Define.
19875         (crypto_hash_function): Use it to convert some newly-signed
19876         variables to unsigned, to avoid sign-extension bugs.  For example,
19877         without this change, (md5 "truc") would evaluate to
19878         45723a2aff78ff4fff7fff1114760e62 rather than the expected
19879         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
19880         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
19882 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
19884         Integer overflow fixes.
19886         * dbusbind.c: Serial number integer overflow fixes.
19887         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
19888         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19889         to hold a serial number that is too large for a fixnum.
19890         (Fdbus_method_return_internal, Fdbus_method_error_internal):
19891         Check for serial numbers out of range.  Decode any serial number
19892         that was so large that it became a float.  (Bug#8722)
19894         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19895         (Fdbus_call_method, Fdbus_call_method_asynchronously):
19896         Use XFASTINT rather than XUINT when numbers are nonnegative.
19897         (xd_append_arg, Fdbus_method_return_internal):
19898         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
19899         arguments, check that Lisp number is nonnegative, rather than
19900         silently wrapping negative numbers around.  (Bug#8722)
19901         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
19902         (Bug#8722)
19904         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19906         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19908         ccl: Add integer overflow checks.
19909         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19910         (IN_INT_RANGE): New macros.
19911         (ccl_driver): Use them to check for integer overflow when
19912         decoding a CCL program.  Many of the new checks are whether XINT (x)
19913         fits in int; it doesn't always, on 64-bit hosts.  The new version
19914         doesn't catch all possible integer overflows, but it's an
19915         improvement.  (Bug#8719)
19917         * alloc.c (make_event_array): Use XINT, not XUINT.
19918         There's no need for unsigned here.
19920         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19921         This follows up to the 2011-05-06 change that substituted uintptr_t
19922         for EMACS_INT.  This case wasn't caught back then.
19924         Rework Fformat to avoid integer overflow issues.
19925         * editfns.c: Include <float.h> unconditionally, as it's everywhere
19926         now (part of C89).  Include <verify.h>.
19927         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19928         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19929         (Fformat): Avoid the prepass trying to compute sizes; it was only
19930         approximate and thus did not catch overflow reliably.  Instead, walk
19931         through the format just once, formatting and computing sizes as we go,
19932         checking for integer overflow at every step, and allocating a larger
19933         buffer as needed.  Keep track separately whether the format is
19934         multibyte.  Keep only the most-recently calculated precision, rather
19935         than them all.  Record whether each argument has been converted to
19936         string.  Use EMACS_INT, not int, for byte and char and arg counts.
19937         Support field widths and precisions larger than INT_MAX.  Avoid
19938         sprintf's undefined behavior with conversion specifications such as %#d
19939         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
19940         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
19941         formatting out-of-range floating point numbers with int
19942         formats.  (Bug#8668)
19944         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19946         * data.c: Avoid integer truncation in expressions involving floats.
19947         * data.c: Include <intprops.h>.
19948         (arith_driver): When there's an integer overflow in an expression
19949         involving floating point, convert the integers to floating point
19950         so that the resulting value does not suffer from catastrophic
19951         integer truncation.  For example, on a 64-bit host (* 4
19952         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19953         Do not rely on undefined behavior after integer overflow.
19955         merge count_size_as_multibyte, parse_str_to_multibyte
19956         * character.c, character.h (count_size_as_multibyte):
19957         Rename from parse_str_to_multibyte; all uses changed.
19958         Check for integer overflow.
19959         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19960         since it's now a duplicate of the other.  This is more of
19961         a character than a buffer op, so better that it's in character.c.
19962         * fns.c, print.c: Adjust to above changes.
19964 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
19966         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19968 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
19970         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19971         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19972         (x_clipboard_manager_save): Now static.
19973         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19975         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19976         (crypto_hash_function): Now static.
19977         Fix pointer signedness problems.  Avoid unnecessary initializations.
19979 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
19981         * termhooks.h (Vselection_alist): Make it terminal-local.
19983         * terminal.c (create_terminal): Initialize it.
19985         * xselect.c: Support for clipboard managers.
19986         (Vselection_alist): Move to termhooks.h as terminal-local var.
19987         (LOCAL_SELECTION): New macro.
19988         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19989         (symbol_to_x_atom): Remove gratuitous arg.
19990         (x_handle_selection_request, lisp_data_to_selection_data)
19991         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
19992         (x_own_selection, x_get_local_selection, x_convert_selection):
19993         New arg, specifying work frame.  Use terminal-local Vselection_alist.
19994         (some_frame_on_display): Delete unused function.
19995         (Fx_own_selection_internal, Fx_get_selection_internal)
19996         (Fx_disown_selection_internal, Fx_selection_owner_p)
19997         (Fx_selection_exists_p): New optional frame arg.
19998         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19999         (x_handle_selection_clear): Don't treat other terminals with the
20000         same keyboard specially.  Use the terminal-local Vselection_alist.
20001         (x_clear_frame_selections): Use Frun_hook_with_args.
20003         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20005         * xterm.h: Add support for those atoms.
20007 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
20009         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20010         (converted_selections, conversion_fail_tag): New global variables.
20011         (x_selection_request_lisp_error): Free the above.
20012         (x_get_local_selection): Remove unnecessary code.
20013         (x_reply_selection_request): Args changed; handle arbitrary array
20014         of converted selections stored in converted_selections.
20015         Separate the XChangeProperty and SelectionNotify steps.
20016         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20017         (x_convert_selection): New function.
20018         (x_handle_selection_event): Simplify.
20019         (x_get_foreign_selection): Don't ignore incoming requests while
20020         waiting for an answer; this will fail when we implement
20021         SAVE_TARGETS, and seems unnecessary anyway.
20022         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20023         (Vx_sent_selection_functions): Doc fix.
20025 2011-05-26  Leo Liu  <sdl.web@gmail.com>
20027         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
20029 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
20031         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20033         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20034         for fringe update if it has periodic bitmap.
20035         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
20036         and fringe_bitmap_periodic_p.
20038         * fringe.c (get_fringe_bitmap_data): New function.
20039         (draw_fringe_bitmap_1, update_window_fringes): Use it.
20040         (update_window_fringes): Record periodicity of fringe bitmap in glyph
20041         row.  Mark glyph row for fringe update if periodicity changed.
20043         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20044         for fringe update unless it has periodic bitmap.
20046 2011-05-25  Kenichi Handa  <handa@m17n.org>
20048         * xdisp.c (get_next_display_element): Set correct it->face_id for
20049         a static composition.
20051 2011-05-24  Leo Liu  <sdl.web@gmail.com>
20053         * deps.mk (fns.o):
20054         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20056         * fns.c (crypto_hash_function, Fsha1): New function.
20057         (Fmd5): Use crypto_hash_function.
20058         (syms_of_fns): Add Ssha1.
20060 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
20062         * gnutls.c: Remove unused macros.
20063         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20064         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20065         Remove macros that are defined and never used.
20066         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20068 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
20070         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20071         (Fx_get_selection_internal): Minor cleanup.
20072         (Fx_own_selection_internal): Rename arguments for consistency with
20073         select.el.
20075 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
20077         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20079 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
20081         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20083 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
20085         * dispnew.c (scrolling_window): Don't exclude the case that the
20086         last enabled row in the desired matrix touches the bottom boundary.
20088 2011-05-21  Glenn Morris  <rgm@gnu.org>
20090         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
20091         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20092         and add some more files.
20094 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
20096         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20097         report_file_error introduced by the change from 2011-05-07.
20099 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
20101         * systime.h (Time): Define only if emacs is defined.
20102         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20103         where the include path doesn't have X11/X.h by default.  See
20104         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20106 2011-05-20  Kenichi Handa  <handa@m17n.org>
20108         * composite.c (find_automatic_composition): Fix previous change.
20110 2011-05-20  Glenn Morris  <rgm@gnu.org>
20112         * lisp.mk: New file, split from Makefile.in.
20113         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20114         (shortlisp): Remove.
20115         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20117 2011-05-19  Glenn Morris  <rgm@gnu.org>
20119         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20120         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20121         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20122         (lisp): Set the order to that of loadup.el.
20123         (shortlisp): Make it a copy of $lisp.
20124         (SOME_MACHINE_LISP): Remove.
20125         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20126         Use just $shortlisp, not $SOME_MACHINE_LISP too.
20128 2011-05-18  Kenichi Handa  <handa@m17n.org>
20130         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20131         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20132         (find_automatic_composition): Mostly rewrite for efficiency.
20134 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
20136         * makefile.w32-in: Update dependencies.
20138 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
20140         * menu.c: Include limits.h (fixes the MS-Windows build broken by
20141         2011-06-18T18:49:19Z!cyd@stupidchicken.com).
20143 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
20145         Fix some integer overflow issues, such as string length overflow.
20147         * insdel.c (count_size_as_multibyte): Check for string overflow.
20149         * character.c (lisp_string_width): Check for string overflow.
20150         Use EMACS_INT, not int, for string indexes and lengths; in
20151         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
20152         the resulting string length overflows an EMACS_INT; instead,
20153         report a string overflow if no precision given.  When checking for
20154         precision exhaustion, use a check that cannot possibly have
20155         integer overflow.  (Bug#8675)
20156         * character.h (lisp_string_width): Adjust to new signature.
20158         * alloc.c (string_overflow): New function.
20159         (Fmake_string): Use it.  This doesn't change behavior, but saves
20160         a few bytes and will simplify future changes.
20161         * character.c (string_escape_byte8): Likewise.
20162         * lisp.h (string_overflow): New decl.
20164         Fixups, following up to the user-interface timestamp change.
20165         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20166         for UI timestamps, instead of unsigned long.
20167         * msdos.c (mouse_get_pos): Likewise.
20168         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
20169         * w32gui.h (Time): Define by including "systime.h" rather than by
20170         declaring it ourselves.  (Bug#8664)
20172         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20173         * image.c (clear_image_cache): Likewise.
20175         * term.c (term_mouse_position): Don't assume time_t wraparound.
20177         Be more systematic about user-interface timestamps.
20178         Before, the code sometimes used 'Time', sometimes 'unsigned long',
20179         and sometimes 'EMACS_UINT', to represent these timestamps.
20180         This change causes it to use 'Time' uniformly, as that's what X uses.
20181         This makes the code easier to follow, and makes it easier to catch
20182         integer overflow bugs such as Bug#8664.
20183         * frame.c (Fmouse_position, Fmouse_pixel_position):
20184         Use Time, not unsigned long, for user-interface timestamps.
20185         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20186         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20187         * keyboard.h (last_event_timestamp): Likewise.
20188         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20189         * menu.h (xmenu_show): Likewise.
20190         * term.c (term_mouse_position): Likewise.
20191         * termhooks.h (struct input_event.timestamp): Likewise.
20192         (struct terminal.mouse_position_hook): Likewise.
20193         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20194         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20195         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
20196         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20197         what it was before.
20198         * menu.h, termhooks.h: Include "systime.h", for Time.
20200         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20201         Don't assume that the difference between two unsigned long values
20202         can fit into an integer.  At this point, we know button_down_time
20203         <= event->timestamp, so the difference must be nonnegative, so
20204         there's no need to cast the result if double-click-time is
20205         nonnegative, as it should be; check that it's nonnegative, just in
20206         case.  This bug is triggered when events are more than 2**31 ms
20207         apart (about 25 days).  (Bug#8664)
20209         * xselect.c (last_event_timestamp): Remove duplicate decl.
20210         (x_own_selection): Remove needless cast to unsigned long.
20212         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20213         that always fit in int.  Use a sentinel instead of a counter, to
20214         avoid a temp and to allay GCC's concerns about possible int overflow.
20215         * frame.h (struct frame): Use int for menu_bar_items_used
20216         instead of EMACS_INT, since it always fits in int.
20218         * menu.c (grow_menu_items): Check for int overflow.
20220         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20222         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20223         Before, the code was not consistent.  These values cannot exceed
20224         2**31 - 1 so there's no need to make them unsigned.
20225         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20226         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20227         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20228         as modifiers.
20229         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20231         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20232         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20233         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20234         presumably because the widths might not match.
20236         * window.c (size_window): Avoid needless test at loop start.
20238 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
20240         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20242 2011-05-12  Drew Adams  <drew.adams@oracle.com>
20244         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20246 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
20248         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20249         `width' to `bar_area_x' and `bar_area_width', respectively.
20250         (x_scroll_run): Take account of fringe background extension.
20252         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20253         Rename local vars `left' and `width' to `bar_area_x' and
20254         `bar_area_width', respectively.
20255         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20256         background extension.
20258 2011-05-10  Jim Meyering  <meyering@redhat.com>
20260         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20262 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
20264         * image.c (Finit_image_library): Return t for built-in image types,
20265         like pbm and xbm.  (Bug#8640)
20267 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
20269         * w32menu.c (set_frame_menubar): Fix submenu allocation.
20271 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
20273         * w32console.c (Fset_screen_color): Doc fix.
20274         (Fget_screen_color): New function.
20275         (syms_of_ntterm): Defsubr it.
20277         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20278         unlink the temporary file if Fcall_process didn't create it in the
20279         first place.
20280         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20281         child process will be redirected to a file specified with `:file'.
20282         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20283         cue to call_process_cleanup not to close that handle.
20285 2011-05-07  Ben Key  <bkey76@gmail.com>
20287         * makefile.w32-in: The bootstrap-temacs rule now makes use of
20288         one of two shell specific rules, either bootstrap-temacs-CMD or
20289         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
20290         to the previous implementation of the bootstrap-temacs rule.
20291         The bootstrap-temacs-CMD rule is similar to the previous
20292         implementation of the bootstrap-temacs rule except that it
20293         makes use of the ESC_CFLAGS variable instead of the CFLAGS
20294         variable.
20296         These changes, along with some changes to nt/configure.bat,
20297         nt/gmake.defs, and nt/nmake.defs, are required to extend my
20298         earlier fix to add support for --cflags and --ldflags options
20299         that include quotes so that it works whether make uses cmd or
20300         sh as the shell.
20302 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
20304         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20305         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20306         is a constant.
20307         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20308         a string.  Handle both cases.
20309         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20310         (Fdbus_register_method): Use Qinvalid_function.
20312 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
20314         * makefile.w32-in: Update dependencies.
20315         (LISP_H): Add inttypes.h and stdin.h.
20316         (PROCESS_H): Add unistd.h.
20318 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
20320         * lread.c: Include limits.h (fixes the MS-Windows build broken by
20321         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20323 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
20325         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20327         * term.c (vfatal): Remove stray call to va_end.
20328         It's not needed and the C Standard doesn't allow it here anyway.
20330         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20331         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
20333         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20334         bytes.
20336         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20338         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20340         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20342         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20344         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20346         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20347         * charset.c (Fdefine_charset_internal): Don't initialize
20348         charset.code_space[15].  The value was garbage, on hosts with
20349         32-bit int (Bug#8600).
20351         * lread.c (read_integer): Be more consistent with string-to-number.
20352         Use string_to_number to do the actual conversion; this avoids
20353         rounding errors and fixes some other screwups.  Without this fix,
20354         for example, #x1fffffffffffffff was misread as -2305843009213693952.
20355         (digit_to_number): Move earlier, for benefit of read_integer.
20356         Return -1 if the digit is out of range for the base, -2 if it is
20357         not a digit in any supported base.  (Bug#8602)
20359         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20361         * dispnew.c (scrolling_window): Return 1 if we scrolled,
20362         to match comment at start of function.  This also removes a
20363         GCC warning about overflow in a 32+64-bit port.
20365         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20367         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20368         Reported by Stefan Monnier in
20369         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
20370         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20371         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
20373         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
20374         (EMACS_UINTPTR): Likewise, with uintptr_t.
20376         * lisp.h: Prefer 64-bit EMACS_INT if available.
20377         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20378         on 32-bit hosts that have 64-bit int, so that they can access
20379         large files.
20380         However, temporarily disable this change unless the temporary
20381         symbol WIDE_EMACS_INT is defined.
20383         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20385         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20386         This removes an assumption that EMACS_INT and long are the same
20387         width as pointers.  The assumption is true for Emacs porting targets
20388         now, but we want to make other targets possible.
20389         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20390         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20391         In the rest of the code, change types of integers that hold casted
20392         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20393         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20394         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20395         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20396         No need to cast type when ORing.
20397         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20398         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20399         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20400         assume EMACS_INT is the same width as char *.
20401         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20402         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20403         Remove no-longer-needed casts.
20404         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20405         (xg_tool_bar_help_callback, xg_make_tool_item):
20406         Use EMACS_INTPTR to hold an integer
20407         that will be cast to void *; this can avoid a GCC warning
20408         if EMACS_INT is not the same width as void *.
20409         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20410         * xdisp.c (display_echo_area_1, resize_mini_window_1):
20411         (current_message_1, set_message_1):
20412         Use a local to convert to proper width without a cast.
20413         * xmenu.c (dialog_selection_callback): Likewise.
20415         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20416         Also, don't assume VALBITS / RAND_BITS is less than 5,
20417         and don't rely on undefined behavior when shifting a 1 left into
20418         the sign bit.
20419         * lisp.h (get_random): Change signature to match.
20421         * lread.c (hash_string): Use size_t, not int, for hash computation.
20422         Normally we prefer signed values; but hashing is special, because
20423         it's better to use unsigned division on hash table sizes so that
20424         the remainder is nonnegative.  Also, size_t is the natural width
20425         for hashing into memory.  The previous code used 'int', which doesn't
20426         retain enough info to hash well into very large tables.
20427         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20429         * dbusbind.c: Don't possibly lose pointer info when converting.
20430         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20431         Use XPNTR rather than XHASH, so that the high-order bits of
20432         the pointer aren't lost when converting through void *.
20434         * eval.c (Fautoload): Don't double-shift a pointer.
20436         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20438 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
20440         * gnutls.c (DEF_GNUTLS_FN):
20441         * image.c (DEF_IMGLIB_FN): Make function pointers static.
20443 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
20445         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20446         marker.  (Bug#8610)
20448 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
20450         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20451         New version that can reserve upto 2GB of heap space.
20453 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
20455         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20457 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
20459         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20460         `gnutls_certificate_set_x509_key_file'.
20462 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
20464         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20465         Update dependencies.
20467 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
20469         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20470         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20471         Remove unused parameter `fildes'.
20472         * process.c (read_process_output, send_process): Don't pass it.
20474 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
20476         Fix previous change: the library cache is defined in w32.c.
20477         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20478         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20480 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
20482         Implement dynamic loading of GnuTLS on Windows.
20484         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20485         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20486         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20487         Declare.
20489         * gnutls.c (Qgnutls_dll): Define.
20490         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20491         (gnutls_*): Declare function pointers.
20492         (init_gnutls_functions): New function to initialize function pointers.
20493         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20494         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20495         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20496         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20497         (emacs_gnutls_write, emacs_gnutls_read)
20498         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20499         (Fgnutls_available_p): New function.
20500         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
20501         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20502         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20504         * image.c: Include w32.h.
20505         (Vimage_type_cache): Delete.
20506         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20507         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20508         (w32_delayed_load): Move to w32.c.
20510         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20512         * w32.c (QCloaded_from, Vlibrary_cache): Define.
20513         (w32_delayed_load): Move from image.c.  When loading a library, record
20514         its filename in the :loaded-from property of the library id.
20515         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20516         Initialize and staticpro them.
20517         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20519         * process.c: Include lisp.h before w32.h, not after.
20520         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20521         instead of gnutls_record_check_pending.
20523         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20525 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
20527         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20528         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
20529         as passed in.
20531 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
20533         * xterm.c (x_set_frame_alpha): Do not set property on anything
20534         else than FRAME_X_OUTER_WINDOW (Bug#8608).
20536 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
20538         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
20540 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
20542         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20543         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20544         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20545         (gnutls_global_initialized, Qgnutls_bootprop_priority)
20546         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20547         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20548         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20549         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20550         (Qgnutls_bootprop_callbacks_verify): Make static.
20552 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
20554         * callproc.c: Indentation fixup.
20556         * sysdep.c (wait_for_termination_1): Make static.
20557         (wait_for_termination, interruptible_wait_for_termination):
20558         Move after wait_for_termination_1.
20560 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
20562         * sysdep.c (interruptible_wait_for_termination): New function
20563         which is like wait_for_termination, but allows keyboard
20564         interruptions.
20566         * callproc.c (Fcall_process): Add (:file "file") as an option for
20567         the STDOUT buffer.
20568         (Fcall_process_region): Ditto.
20570 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
20572         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20573         rather than `XVECTOR (FOO)->size'.
20575         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20576         inttypes.h, as a gnulib replacement is used if it not available in
20577         system headers.
20579 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
20581         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20582         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20583         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
20585         * coding.c (coding_alloc_by_realloc): Error out if destination
20586         will grow beyond MOST_POSITIVE_FIXNUM.
20587         (decode_coding_emacs_mule): Abort if there isn't enough place in
20588         charbuf for the composition carryover bytes.  Reserve an extra
20589         space for up to 2 characters produced in a loop.
20590         (decode_coding_iso_2022): Abort if there isn't enough place in
20591         charbuf for the composition carryover bytes.
20593 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
20595         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20596         aborting when %lld or %lll format is passed.
20597         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20598         %llo or %llx format is passed.  (Bug#8545)
20600         * window.c (window_scroll_line_based): Use a marker instead of
20601         simple variables to record original value of point.  (Bug#7952)
20603         * doprnt.c (doprnt): Fix the case where a multibyte sequence
20604         produced by %s or %c overflows available buffer space.  (Bug#8545)
20606 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
20608         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
20609         (SIZE_MAX): Move defn after all includes, as they might #define it.
20611 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
20613         * w32.c (init_environment): Warn about defaulting HOME to C:\.
20615 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
20617         * keyboard.c (Qdelayed_warnings_hook): Define.
20618         (command_loop_1): Run `delayed-warnings-hook'
20619         if Vdelayed_warnings_list is non-nil.
20620         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20621         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20623 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
20625         * doprnt.c (doprnt): Don't return value smaller than the buffer
20626         size if the message was truncated.  (Bug#8545).
20628 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
20630         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20631         (Fx_window_property): #if-0 the whole functions, not just the bodies.
20633 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
20635         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20637 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
20639         * makefile.w32-in: Update dependencies.
20641 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
20643         Improve `doprnt' and its usage.  (Bug#8545)
20644         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20645         `format_end'.  Remove support for %l as a conversion specifier.
20646         Don't use xrealloc.  Improve diagnostics when the %l size modifier
20647         is used.  Update the commentary.
20649         * eval.c (verror): Simplify calculation of size_t.
20651         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20652         messages.
20654 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
20656         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20657         change.
20659 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
20661         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20662         This makes this file independent of the recent pseudovector change.
20664 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
20666         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20668         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
20669         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
20670         Remove unused local.
20671         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
20673         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
20674         GCC 4.6.0 optimizes based on type-based alias analysis.
20675         For example, if b is of type struct buffer * and v of type struct
20676         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20677         != &v->size, and therefore "v->size = 1; b->size = 2; return
20678         v->size;" must therefore return 1.  This assumption is incorrect
20679         for Emacs, since it type-puns struct Lisp_Vector * with many other
20680         types.  To fix this problem, this patch adds a new type struct
20681         vectorlike_header that documents the constraints on layout of vectors
20682         and pseudovectors, and helps optimizing compilers not get fooled
20683         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
20684         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
20685         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20686         the size member.
20687         (XSETPVECTYPE): Rewrite in terms of new macro.
20688         (XSETPVECTYPESIZE): New macro, specifying both type and size.
20689         This is a bit clearer, and further avoids the possibility of
20690         undesirable aliasing.
20691         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
20692         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
20693         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20694         since Lisp_Subr is a special case (no "next" field).
20695         (ASIZE): Now uses header.size rather than size.
20696         All previous uses of XVECTOR (foo)->size replaced to use this macro,
20697         to avoid the hassle of writing XVECTOR (foo)->header.size.
20698         (struct vectorlike_header): New type.
20699         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20700         object, to help avoid aliasing.
20701         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20702         (SUBRP): Likewise, since Lisp_Subr is a special case.
20703         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20704         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20705         (struct Lisp_Hash_Table): Combine first two members into a single
20706         struct vectorlike_header member.  All uses of "size" and "next" members
20707         changed to be "header.size" and "header.next".
20708         * buffer.h (struct buffer): Likewise.
20709         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20710         * frame.h (struct frame): Likewise.
20711         * process.h (struct Lisp_Process): Likewise.
20712         * termhooks.h (struct terminal): Likewise.
20713         * window.c (struct save_window_data, struct saved_window): Likewise.
20714         * window.h (struct window): Likewise.
20715         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20716         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20717         * buffer.c (init_buffer_once): Likewise.
20718         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20719         special case.
20720         * process.c (Fformat_network_address): Use local var for size,
20721         for brevity.
20723         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20725         Make the Lisp reader and string-to-float more consistent (Bug#8525)
20726         * data.c (atof): Remove decl; no longer used or needed.
20727         (digit_to_number): Move to lread.c.
20728         (Fstring_to_number): Use new string_to_number function, to be
20729         consistent with how the Lisp reader treats infinities and NaNs.
20730         Do not assume that floating-point numbers represent EMACS_INT
20731         without losing information; this is not true on most 64-bit hosts.
20732         Avoid double-rounding errors, by insisting on integers when
20733         parsing non-base-10 numbers, as the documentation specifies.
20734         * lisp.h (string_to_number): New decl, replacing ...
20735         (isfloat_string): Remove.
20736         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
20737         (read1): Do not accept +. and -. as integers; this
20738         appears to have been a coding error.  Similarly, do not accept
20739         strings like +-1e0 as floating point numbers.  Do not report
20740         overflow for integer overflows unless the base is not 10 which
20741         means we have no simple and reliable way to continue.
20742         Break out the floating-point parsing into a new
20743         function string_to_number, so that Fstring_to_number parses
20744         floating point numbers consistently with the Lisp reader.
20745         (digit_to_number): Move here from data.c.  Make it static inline.
20746         (E_CHAR, EXP_INT): Remove, replacing with ...
20747         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20748         (string_to_number): New function, replacing isfloat_string.
20749         This function checks for valid syntax and produces the resulting
20750         Lisp float number too.  Rework it so that string-to-number
20751         no longer mishandles examples like "1.0e+".  Use strtoumax,
20752         so that overflow for non-base-10 numbers is reported only when
20753         there's no portable and simple way to convert to floating point.
20755         * textprop.c (set_text_properties_1): Rewrite for clarity,
20756         and to avoid GCC warning about integer overflow.
20758         * intervals.h (struct interval): Use EMACS_INT for members
20759         where EMACS_UINT might cause problems.  See
20760         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20761         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20762         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20763         All uses changed.
20764         (offset_intervals): Tell GCC not to worry about length overflow
20765         when negating a negative length.
20767         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20768         (overrun_check_free): Likewise.
20770         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20771         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20772         word size.
20774         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20775         (gnutls_make_error): Rename local to avoid shadowing.
20776         (gnutls_emacs_global_deinit): ifdef out; not used.
20777         (Fgnutls_boot): Use const for pointer to readonly storage.
20778         Comment out unused local.  Fix pointer signedness problems.
20780         * lread.c (openp): Don't stuff size_t into an 'int'.
20781         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20782         about possible signed overflow.
20784         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20785         (GDK_KEY_g): Don't define if already defined.
20786         (xg_prepare_tooltip): Avoid pointer signedness problem.
20787         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20789         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20790         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
20792         * xfns.c (Fx_window_property): Simplify a bit,
20793         to make a bit faster and to avoid GCC 4.6.0 warning.
20794         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20796         * fns.c (internal_equal): Don't assume size_t fits in int.
20798         * alloc.c (compact_small_strings): Tighten assertion a little.
20800         Replace pEd with more-general pI, and fix some printf arg casts.
20801         * lisp.h (pI): New macro, generalizing old pEd macro to other
20802         conversion specifiers.  For example, use "...%"pI"d..." rather
20803         than "...%"pEd"...".
20804         (pEd): Remove.  All uses replaced with similar uses of pI.
20805         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
20806         * alloc.c (check_pure_size): Don't overflow by converting size to int.
20807         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20808         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20809         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20810         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20811         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20812         64-bit hosts.
20813         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20814         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20815         * print.c (safe_debug_print, print_object): Likewise.
20816         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20817         to int.
20818         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
20819         avoiding the 0 flag, which is not portable.
20820         * process.c (Fmake_network_process): Use pI to avoid cast.
20821         * region-cache.c (pp_cache): Likewise.
20822         * xdisp.c (decode_mode_spec): Likewise.
20823         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20824         behavior on 64-bit hosts with printf arg.
20825         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
20826         (x_stop_queuing_selection_requests): Likewise.
20827         (x_get_window_property): Don't truncate byte count to an 'int'
20828         when tracing.
20830         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20831         here, since it parses constructs like leading '-' and spaces,
20832         which are not wanted; and it overflows with large numbers.
20833         Instead, simply match F[0-9]+, which is what is wanted anyway.
20835         * alloc.c: Remove unportable assumptions about struct layout.
20836         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20837         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20838         (allocate_vectorlike, make_pure_vector): Use the new macros,
20839         plus offsetof, to remove unportable assumptions about struct layout.
20840         These assumptions hold on all porting targets that I know of, but
20841         they are not guaranteed, they're easy to remove, and removing them
20842         makes further changes easier.
20844         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20845         This doesn't fix a bug but makes the code clearer.
20846         (string_overrun_cookie): Now const.  Use initializers that
20847         don't formally overflow signed char, to avoid warnings.
20848         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20849         can cause Emacs to crash when string overrun checking is enabled.
20850         (allocate_buffer): Don't assume sizeof (struct buffer) is a
20851         multiple of sizeof (EMACS_INT); it need not be, if
20852         alignof(EMACS_INT) < sizeof (EMACS_INT).
20853         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
20855 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
20857         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
20859 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
20861         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
20862         supposed to be handshaking.  (Bug#8556)
20863         Reported by Paul Eggert <eggert@cs.ucla.edu>.
20865 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
20867         * lisp.h (Qdebug): List symbol.
20868         * eval.c (Qdebug): Restore global linkage.
20869         * keyboard.c (debug-on-event): New variable.
20870         (handle_user_signal): Break into debugger when debug-on-event
20871         matches the current signal symbol.
20873 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
20875         * alloc.c (check_sblock, check_string_bytes)
20876         (check_string_free_list): Convert to standard C.
20878 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
20880         * w32.c (emacs_gnutls_push): Fix typo.
20882 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
20884         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20885         "cast to pointer from integer of different size".
20887         Improve doprnt and its use in verror.  (Bug#8545)
20888         * doprnt.c (doprnt): Document the set of format control sequences
20889         supported by the function.  Use SAFE_ALLOCA instead of always
20890         using `alloca'.
20892         * eval.c (verror): Don't limit the buffer size at size_max-1, that
20893         is one byte too soon.  Don't use xrealloc; instead xfree and
20894         xmalloc anew.
20896 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
20898         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20899         callbacks stage.
20901         * gnutls.c: Renamed global_initialized to
20902         gnutls_global_initialized.  Added internals for the
20903         :verify-hostname-error, :verify-error, and :verify-flags
20904         parameters of `gnutls-boot' and documented those parameters in the
20905         docstring.  Start callback support.
20906         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
20907         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
20908         on error.  Return error code.
20909         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20910         (emacs_gnutls_read): Likewise.
20911         (Fgnutls_boot): Return handshake error code.
20912         (emacs_gnutls_handle_error): New function.
20913         (wsaerror_to_errno): Likewise.
20915         * w32.h (emacs_gnutls_pull): Add prototype.
20916         (emacs_gnutls_push): Likewise.
20918         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20919         (emacs_gnutls_push): Likewise.
20921 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
20923         * process.c (wait_reading_process_output): Check if GnuTLS
20924         buffered some data internally if no FDs are set for TLS
20925         connections.
20927         * makefile.w32-in (OBJ2): Add gnutls.$(O).
20928         (LIBS): Link to USER_LIBS.
20929         ($(BLD)/gnutls.$(0)): New target.
20931 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
20933         * xdisp.c (handle_single_display_spec): Rename the
20934         display_replaced_before_p argument into display_replaced_p, to
20935         make it consistent with the commentary.  Fix typos in the
20936         commentary.
20938         * textprop.c (syms_of_textprop): Remove dead code.
20939         (copy_text_properties): Delete obsolete commentary about an
20940         interface that was deleted long ago.  Fix typos in the description
20941         of arguments.
20943         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20944         to changes in oldXMenu/XMenu.h from 2011-04-16.
20945         <menu_help_message, prev_menu_help_message>: Constify.
20946         (IT_menu_make_room): menu->help_text is now `const char **';
20947         adjust.
20949         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20950         to changes in oldXMenu/XMenu.h from 2011-04-16.
20951         (struct XMenu): Declare `help_text' `const char **'.
20953         * xfaces.c <Qunspecified>: Make extern again.
20955         * syntax.c: Include sys/types.h before including regex.h, as
20956         required by POSIX.
20958         * doc.c (get_doc_string): Improve the format passed to `error'.
20960         * doprnt.c (doprnt): Improve commentary.
20962         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20964         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20965         them with etags.
20967         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20968         changes in globals.h immediately force recompilation.
20969         (TAGS): Depend on $(CURDIR)/m/intel386.h and
20970         $(CURDIR)/s/ms-w32.h.
20971         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
20973         * character.c (Fchar_direction): Function deleted.
20974         (syms_of_character): Don't defsubr it.
20975         <char-direction-table>: Deleted.
20977 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
20979         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
20980         * doprnt.c: Include limits.h.
20981         (SIZE_MAX): New macro.
20982         (doprnt): Return a size_t value.  2nd arg is now size_t.
20983         Many local variables are now size_t instead of int or unsigned.
20984         Improve overflow protection.  Support `l' modifier for integer
20985         conversions.  Support %l conversion.  Don't assume an EMACS_INT
20986         argument for integer conversions and for %c.
20988         * lisp.h (doprnt): Restore prototype.
20990         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20991         $(SRC)/character.h.
20993         * Makefile.in (base_obj): Add back doprnt.o.
20995         * deps.mk (doprnt.o): Add back prerequisites.
20996         (callint.o): Depend on character.h.
20998         * eval.c (internal_lisp_condition_case): Include the handler
20999         representation in the error message.
21000         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
21001         when breaking from the loop.
21003         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21005         * callint.c (Fcall_interactively): When displaying error message
21006         about invalid control letter, pass the character's codepoint, not
21007         a pointer to its multibyte form.  Improve display of the character
21008         in octal and display also its hex code.
21010         * character.c (char_string): Use %x to display the (unsigned)
21011         codepoint of an invalid character, to avoid displaying a bogus
21012         negative value.
21014         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21015         `error', not SYMBOL_NAME itself.
21017         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21018         character arguments to `error'.
21020         * charset.c (check_iso_charset_parameter): Fix incorrect argument
21021         to `error' in error message about FINAL_CHAR argument.  Make sure
21022         FINAL_CHAR is a character, and use %c when it is passed as
21023         argument to `error'.
21025 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
21027         * s/ms-w32.h (localtime): Redirect to sys_localtime.
21029         * w32.c: Include <time.h>.
21030         (sys_localtime): New function.
21032 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
21034         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21036         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
21038 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
21040         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21041         zombies (Bug#8467).
21043 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
21045         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21046         gl_state.e_property when gl_state.object is Qt.
21048         * insdel.c (make_gap_larger): Remove limitation of buffer size
21049         to <= INT_MAX.
21051 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
21053         * xdisp.c (lookup_glyphless_char_display)
21054         (produce_glyphless_glyph): Handle cons cell entry in
21055         glyphless-char-display.
21056         (Vglyphless_char_display): Document it.
21058         * term.c (produce_glyphless_glyph): Handle cons cell entry in
21059         glyphless-char-display.
21061 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
21063         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21065         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21067         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21068         definition for no-X builds.
21070 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
21072         Static checks with GCC 4.6.0 and non-default toolkits.
21074         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21076         * process.c (keyboard_bit_set): Define only if SIGIO.
21077         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21078         (send_process): Repair possible setjmp clobbering.
21080         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21082         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21084         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21086         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21087         Define only if needed.
21089         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21090         by pacifying GCC about it.  Maybe it's time to retire it?
21091         * xfaces.c (USG, __TIMEVAL__): Likewise.
21093         * dispextern.h (struct redisplay_interface): Rename param
21094         to avoid shadowing.
21095         * termhooks.h (struct terminal): Likewise.
21096         * xterm.c (xembed_send_message): Likewise.
21098         * insdel.c (make_gap_smaller): Define only if
21099         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21101         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21102         it.
21104         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21105         so that we aren't warned about unused symbols.
21107         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21109         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
21111         * xfns.c (x_real_positions): Mark locals as initialized.
21113         * xmenu.c (xmenu_show): Don't use uninitialized vars.
21115         * xterm.c: Fix problems found by static analysis with other toolkits.
21116         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
21117         (x_dispatch_event): Declare static if USE_GTK, and
21118         define if USE_GTK || USE_X_TOOLKIT.
21119         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
21120         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
21121         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21122         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
21124         * xmenu.c (menu_help_callback): Pointer type fixes.
21125         Use const pointers when pointing at readonly data.  Avoid pointer
21126         signedness clashes.
21127         (FALSE): Remove unused macro.
21128         (update_frame_menubar): Remove unused decl.
21130         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21132         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21133         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21134         (single_menu_item): Rename local to avoid shadowing.
21136         * keyboard.c (make_lispy_event): Remove unused local var.
21138         * frame.c, frame.h (x_get_resource_string): Bring this back, but
21139         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21141         * bitmaps: Change bitmaps from unsigned char back to the X11
21142         compatible char.  Avoid the old compiler warnings about
21143         out-of-range initializers by using, for example, '\xab' rather
21144         than 0xab.
21146         * xgselect.c (xgselect_initialize): Check vs interface
21147         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21149         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21151         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21152         to read-only memory.
21154         * fns.c (vector): Remove; this old hack is no longer needed.
21156         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
21157         Remove unused var.
21158         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
21160         * xrdb.c (x_load_resources): Omit unused local.
21162         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
21163         (x_window): Rename locals to avoid shadowing.
21164         (USG): Use the kludged USG macro, to pacify gcc.
21166         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
21167         (x_term_init): Remove local to avoid shadowing.
21169         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
21171         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21172         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21174 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
21176         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21178         Fix regex.c, syntax.c and friends for buffers > 2GB.
21179         * syntax.h (struct gl_state_s): Declare character position members
21180         EMACS_INT.
21182         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21184         * textprop.c (verify_interval_modification, interval_of):
21185         Declare arguments EMACS_INT.
21187         * intervals.c (adjust_intervals_for_insertion): Declare arguments
21188         EMACS_INT.
21190         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21192         * indent.c (Fvertical_motion): Local variable it_start is now
21193         EMACS_INT.
21195         * regex.c (re_match, re_match_2, re_match_2_internal)
21196         (bcmp_translate, regcomp, regexec, print_double_string)
21197         (group_in_compile_stack, re_search, re_search_2, regex_compile)
21198         (re_compile_pattern, re_exec): Declare arguments and local
21199         variables `size_t' and `ssize_t' and return values `regoff_t', as
21200         appropriate.
21201         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21202         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21203         <compile_stack_type>: `size' and `avail' are now `size_t'.
21205         * regex.h <regoff_t>: Use ssize_t, not int.
21206         (re_search, re_search_2, re_match, re_match_2): Arguments that
21207         specify buffer/string position and length are now ssize_t and
21208         size_t.  Return type is regoff_t.
21210 2011-04-16  Ben Key  <bkey76@gmail.com>
21212         * nsfont.m: Fixed bugs in ns_get_family and
21213         ns_descriptor_to_entity that were caused by using free to
21214         deallocate memory blocks that were allocated by xmalloc (via
21215         xstrdup).  This caused Emacs to crash when compiled with
21216         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21217         --enable-checking=xmallocoverrun).  xfree is now used to
21218         deallocate these memory blocks.
21220 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
21222         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21224         emacs_write: Accept and return EMACS_INT for sizes.
21225         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21226         et seq.
21227         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21228         Accept and return EMACS_INT.
21229         (emacs_gnutls_write): Return the number of bytes written on
21230         partial writes.
21231         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
21232         (emacs_read, emacs_write): Remove check for negative size, as the
21233         Emacs source code has been audited now.
21234         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21235         (emacs_read, emacs_write): Use it.
21236         * process.c (send_process): Adjust to the new signatures of
21237         emacs_write and emacs_gnutls_write.  Do not attempt to store
21238         a byte offset into an 'int'; it might overflow.
21239         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
21241         * sound.c: Don't assume sizes fit in 'int'.
21242         (struct sound_device.period_size, alsa_period_size):
21243         Return EMACS_INT, not int.
21244         (struct sound_device.write, vox_write, alsa_write):
21245         Accept EMACS_INT, not int.
21246         (wav_play, au_play): Use EMACS_INT to store sizes and to
21247         record read return values.
21249 2011-04-15  Ben Key  <bkey76@gmail.com>
21251         * keyboard.c (Qundefined): Don't declare static since it is used
21252         in nsfns.m.
21253         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21254         static since they are used in nsfont.m.
21256 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
21258         * process.c (Qprocessp): Don't declare static.
21259         * lisp.h (Qprocessp): Declare again.
21261 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
21263         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21265 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
21267         Improve C-level modularity by making more things 'static'.
21269         Don't publish debugger-only interfaces to other modules.
21270         * lisp.h (safe_debug_print, debug_output_compilation_hack):
21271         (verify_bytepos, count_markers): Move decls to the only modules
21272         that need them.
21273         * region-cache.h (pp_cache): Likewise.
21274         * window.h (check_all_windows): Likewise.
21275         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21277         * sysdep.c (croak): Now static, if
21278         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21279         * syssignal.h (croak): Declare only if not static.
21281         * alloc.c (refill_memory_reserve): Now static if
21282         !defined REL_ALLOC || defined SYSTEM_MALLOC.
21283         * lisp.h (refill_memory_reserve): Declare only if not static.
21285         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21286         Define only if USE_LUCID.
21288         * xrdb.c (x_customization_string, x_rm_string): Now static.
21290         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21291         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21293         * xdisp.c (draw_row_with_mouse_face): Now static.
21294         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21296         * window.h (check_all_windows): Mark externally visible.
21298         * window.c (window_deletion_count): Now static.
21300         * undo.c: Make symbols static if they're not exported.
21301         (last_undo_buffer, last_boundary_position, pending_boundary):
21302         Now static.
21304         * textprop.c (interval_insert_behind_hooks): Now static.
21305         (interval_insert_in_front_hooks): Likewise.
21307         * term.c: Make symbols static if they're not exported.
21308         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21309         (max_frame_lines, tty_set_terminal_modes):
21310         (tty_reset_terminal_modes, tty_turn_off_highlight):
21311         (get_tty_terminal): Now static.
21312         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21313         * termhooks.h (term_mouse_moveto): Do not declare if
21314         HAVE_WINDOW_SYSTEM.
21315         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21316         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21318         * sysdep.c: Make symbols static if they're not exported.
21319         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21320         Now static.
21321         (sigprocmask_set, full_mask): Remove; unused.
21322         (wait_debugging): Mark as visible.
21323         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21324         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21326         * syntax.c (syntax_temp): Define only if !__GNUC__.
21328         * sound.c (current_sound_device, current_sound): Now static.
21330         * search.c (searchbufs, searchbuf_head): Now static.
21332         * scroll.c (scroll_cost): Remove; unused.
21333         * dispextern.h (scroll_cost): Remove decl.
21335         * region-cache.h (pp_cache): Mark as externally visible.
21337         * process.c: Make symbols static if they're not exported.
21338         (process_tick, update_tick, create_process, chan_process):
21339         (Vprocess_alist, proc_buffered_char, datagram_access):
21340         (fd_callback_data, send_process_frame, process_sent_to): Now static.
21341         (deactivate_process): Mark defn as static, as well as decl.
21342         * lisp.h (create_process): Remove decl.
21343         * process.h (chan_process, Vprocess_alist): Remove decls.
21345         * print.c: Make symbols static if they're not exported.
21346         (print_depth, new_backquote_output, being_printed, print_buffer):
21347         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21348         (print_interval, print_number_index, initial_stderr_stream):
21349         Now static.
21350         * lisp.h (Fprinc): Remove decl.
21351         (debug_output_compilation_hack): Mark as externally visible.
21353         * sysdep.c (croak): Move decl from here to syssignal.h.
21354         * syssignal.h (croak): Put it here, so the API can be checked when
21355         'croak' is called from dissociate_if_controlling_tty.
21357         * minibuf.c: Make symbols static if they're not exported.
21358         (minibuf_save_list, choose_minibuf_frame): Now static.
21359         * lisp.h (choose_minibuf_frame): Remove decl.
21361         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21363         * lread.c: Make symbols static if they're not exported.
21364         (read_objects, initial_obarray, oblookup_last_bucket_number):
21365         Now static.
21366         (make_symbol): Remove; unused.
21367         * lisp.h (initial_obarray, make_symbol): Remove decls.
21369         * keyboard.c: Make symbols static if they're not exported.
21370         (single_kboard, recent_keys_index, total_keys, recent_keys):
21371         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21372         (this_single_command_key_start, echoing, last_auto_save):
21373         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21374         (command_loop, echo_now, keyboard_init_hook, help_char_p):
21375         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21376         (Vlispy_mouse_stem, double_click_count):
21377         Now static.
21378         (force_auto_save_soon): Define only if SIGDANGER.
21379         (ignore_mouse_drag_p): Now static if
21380         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21381         (print_help): Remove; unused.
21382         (stop_character, last_timer_event): Mark as externally visible.
21383         * keyboard.h (ignore_mouse_drag_p): Declare only if
21384         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21385         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21386         * lisp.h (echoing): Remove decl.
21387         (force_auto_save_soon): Declare only if SIGDANGER.
21388         * xdisp.c (redisplay_window): Simplify code, to make it more
21389         obvious that ignore_mouse_drag_p is not accessed if !defined
21390         USE_GTK && !defined HAVE_NS.
21392         * intervals.c: Make symbols static if they're not exported.
21393         (merge_properties_sticky, merge_interval_right, delete_interval):
21394         Now static.
21395         * intervals.h (merge_interval_right, delete_interval): Remove decls.
21397         * insdel.c: Make symbols static if they're not exported.
21398         However, leave prepare_to_modify_buffer alone.  It's never
21399         called from outside this function, but that appears to be a bug.
21400         (combine_after_change_list, combine_after_change_buffer):
21401         (adjust_after_replace, signal_before_change): Now static.
21402         (adjust_after_replace_noundo): Remove; unused.
21403         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
21404         (signal_before_change): Remove decls.
21406         * indent.c (val_compute_motion, val_vmotion): Now static.
21408         * image.c: Make symbols static if they're not exported.
21409         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21410         if USE_GTK.
21411         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21412         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21414         * fringe.c (standard_bitmaps): Now static.
21415         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21417         * frame.c: Make symbols static if they're not exported.
21418         (x_report_frame_params, make_terminal_frame): Now static.
21419         (get_frame_param): Now static, unless HAVE_NS.
21420         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21421         (x_get_resource_string): Remove; not used.
21422         * frame.h (make_terminal_frame, x_report_frame_params):
21423         (x_get_resource_string); Remove decls.
21424         (x_fullscreen_adjust): Declare only if WINDOWSNT.
21425         * lisp.h (get_frame_param): Declare only if HAVE_NS.
21427         * font.c, fontset.c: Make symbols static if they're not exported.
21428         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21429         (FACE_SUITABLE_FOR_CHAR_P): Use it.
21430         * font.c (font_close_object): Now static.
21431         * font.h (font_close_object): Remove.
21432         * fontset.c (FONTSET_OBJLIST): Remove.
21433         (free_realized_fontset) #if-0 the body, which does nothing.
21434         (face_suitable_for_char_p): #if-0, as it's never called.
21435         * fontset.h (face_suitable_for_char_p): Remove decl.
21436         * xfaces.c (face_at_string_position):
21437         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
21438         since 0 is always ASCII.
21440         * fns.c (weak_hash_tables): Now static.
21442         * fileio.c: Make symbols static if they're not exported.
21443         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21444         (Vwrite_region_annotation_buffers): Now static.
21446         * eval.c: Make symbols static if they're not exported.
21447         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21448         * lisp.h (backtrace_list): Remove decl.
21450         * emacs.c: Make symbols static if they're not exported.
21451         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21452         (fatal_error_code, fatal_error_signal_hook, standard_args):
21453         Now static.
21454         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21455         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21456         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21457         * lisp.h (fatal_error_signal_hook): Remove decl.
21458         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21460         * editfns.c: Move a (normally-unused) function to its only use.
21461         * editfns.c, lisp.h (get_operating_system_release): Remove.
21462         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21463         worth the hassle of breaking this out.
21465         * xterm.c: Make symbols static if they're not exported.
21466         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21467         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21468         (x_destroy_window, x_delete_display):
21469         Now static.
21470         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21471         (x_mouse_leave): Remove; unused.
21472         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21473         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21474         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21475         Remove decls.
21476         (x_mouse_leave): Declare only if WINDOWSNT.
21477         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21478         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21479         USE_X_TOOLKIT.
21481         * ftxfont.c: Make symbols static if they're not exported.
21482         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21483         HAVE_FREETYPE.
21484         * font.h (ftxfont_driver): Likewise.
21486         * xfns.c: Make symbols static if they're not exported.
21487         (x_last_font_name, x_display_info_for_name):
21488         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21489         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21490         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21491         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21492         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21493         (last_show_tip_args): Now static.
21494         (xic_defaut_fontset, xic_create_fontsetname): Define only if
21495         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21496         (x_screen_planes): Remove; unused.
21497         * dispextern.h (x_screen_planes): Remove decl.
21499         * dispnew.c: Make symbols static if they're not exported.
21500         * dispextern.h (redraw_garbaged_frames, scrolling):
21501         (increment_row_positions): Remove.
21502         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21503         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21504         Now static.
21505         (redraw_garbaged_frames): Remove; unused.
21507         * xfaces.c: Make symbols static if they're not exported.
21508         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21509         Remove decls.
21510         * xterm.h (defined_color): Remove decls.
21511         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21512         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21513         (menu_face_changed_default, defined_color, free_realized_face):
21514         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21515         (ascii_face_of_lisp_face): Remove; unused.
21517         * xdisp.c: Make symbols static if they're not exported.
21518         * dispextern.h (scratch_glyph_row, window_box_edges):
21519         (glyph_to_pixel_coords, set_cursor_from_row):
21520         (get_next_display_element, set_iterator_to_next):
21521         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21522         (show_mouse_face): Remove decls
21523         * frame.h (message_buf_print): Likewise.
21524         * lisp.h (pop_message, set_message, check_point_in_composition):
21525         Likewise.
21526         * xterm.h (set_vertical_scroll_bar): Likewise.
21527         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21528         (message_buf_print, scratch_glyph_row, displayed_buffer):
21529         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21530         (get_next_display_element, show_mouse_face, window_box_edges):
21531         (frame_to_window_pixel_xy, check_point_in_composition):
21532         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21533         (glyph_to_pixel_coords): Remove; unused.
21535         * dired.c (file_name_completion): Now static.
21537         * dbusbind.c (xd_in_read_queued_messages): Now static.
21539         * lisp.h (circular_list_error, FOREACH): Remove; unused.
21540         * data.c (circular_list_error): Remove.
21542         * commands.h (last_point_position, last_point_position_buffer):
21543         (last_point_position_window): Remove decls.
21544         * keyboard.c: Make these variables static.
21546         * coding.h (coding, code_convert_region, encode_coding_gap):
21547         Remove decls.
21548         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21549         (iso_code_class, detect_coding, code_convert_region): Now static.
21550         (encode_coding_gap): Remove; unused.
21552         * chartab.c (chartab_chars, chartab_bits): Now static.
21554         * charset.h (charset_iso_8859_1): Remove decl.
21555         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21556         Now static.
21558         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21559         * ccl.c (Vccl_program_table): Now static.
21560         (check_ccl_update): Remove; unused.
21562         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21563         * category.h: ... from here.
21564         * category.c (check_category_table, set_category_set): Now static.
21566         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21567         * lisp.h: Remove these decls.
21569         * buffer.c (buffer_count): Remove unused var.
21571         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21572         so that it's not optimized away.
21573         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21574         * dispextern.h (bidi_dump_cached_states): Remove, since it's
21575         exported only to the debugger.
21577         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
21578         * atimer.h (run_all_atimers): Remove; not exported.
21580         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21581         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21582         was inaccessible from Lisp.
21583         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21584         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21586         alloc.c: Import and export fewer symbols, and remove unused items.
21587         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21588         is defined.
21589         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21590         it's not optimized away by whole-program optimization.
21591         (message_enable_multibyte, free_misc): Remove.
21592         (catchlist, handlerlist, mark_backtrace):
21593         Declare only if BYTE_MARK_STACK.
21594         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21595         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21596         (message_enable_multibyte): Remove decl.
21597         (free_misc, interval_free_list, float_block, float_block_index):
21598         (n_float_blocks, float_free_list, cons_block, cons_block_index):
21599         (cons_free_list, last_marked_index):
21600         Now static.
21601         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21602         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21603         (mark_backtrace): Define only if BYTE_MARK_STACK.
21604         * xdisp.c (message_enable_multibyte): Now static.
21606         Declare Lisp_Object Q* variables to be 'static' if not exported.
21607         This makes it easier for human readers (and static analyzers)
21608         to see whether these variables are used from other modules.
21609         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21610         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21611         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21612         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21613         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21614         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21615         * xmenu.c, xselect.c:
21616         Declare Q* vars static if they are not used in other modules.
21617         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21618         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21619         Remove decls of unexported vars.
21620         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21622         * lisp.h (DEFINE_FUNC): Make sname 'static'.
21624         Make Emacs functions such as Fatom 'static' by default.
21625         This makes it easier for human readers (and static analyzers)
21626         to see whether these functions can be called from other modules.
21627         DEFUN now defines a static function.  To make the function external
21628         so that it can be used in other C modules, use the new macro DEFUE.
21629         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21630         (Finit_image_library):
21631         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21632         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21633         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21634         Remove decls, since these functions are now static.
21635         (Funintern, Fget_internal_run_time): New decls, since these functions
21636         were already external.
21638         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21639         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21640         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21641         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21642         * keyboard.c, keymap.c, lread.c:
21643         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21644         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21645         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21646         Mark functions with DEFUE instead of DEFUN,
21647         if they are used in other modules.
21648         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21649         decls for now-static functions.
21650         * buffer.h (Fdelete_overlay): Remove decl.
21651         * callproc.c (Fgetenv_internal): Mark as internal.
21652         * composite.c (Fremove_list_of_text_properties): Remove decl.
21653         (Fcomposition_get_gstring): New forward static decl.
21654         * composite.h (Fcomposite_get_gstring): Remove decl.
21655         * dired.c (Ffile_attributes): New forward static decl.
21656         * doc.c (Fdocumntation_property): New forward static decl.
21657         * eval.c (Ffetch_bytecode): New forward static decl.
21658         (Funintern): Remove extern decl; now in .h file where it belongs.
21659         * fileio.c (Fmake_symbolic_link): New forward static decl.
21660         * image.c (Finit_image_library): New forward static decl.
21661         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21662         * intervals.h (Fprevious_property_change):
21663         (Fremove_list_of_text_properties): Remove decls.
21664         * keyboard.c (Fthis_command_keys): Remove decl.
21665         (Fcommand_execute): New forward static decl.
21666         * keymap.c (Flookup_key): New forward static decl.
21667         (Fcopy_keymap): Now static.
21668         * keymap.h (Flookup_key): Remove decl.
21669         * process.c (Fget_process): New forward static decl.
21670         (Fprocess_datagram_address): Mark as internal.
21671         * syntax.c (Fsyntax_table_p): New forward static decl.
21672         (skip_chars): Remove duplicate decl.
21673         * textprop.c (Fprevious_property_change): New forward static decl.
21674         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21675         Now internal.
21676         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21677         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21679         * editfns.c (Fformat): Remove unreachable code.
21681 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
21683         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21684         change.  (Bug#8496)
21686 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
21688         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21689         when at ZV.  (Bug#8487)
21691 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
21693         * charset.c (Fclear_charset_maps): Use xfree instead of free.
21694         (Bug#8437)
21695         * keyboard.c (parse_tool_bar_item): Likewise.
21696         * sound.c (sound_cleanup, alsa_close): Likewise.
21697         * termcap.c (tgetent): Likewise.
21698         * xfns.c (x_default_font_parameter): Likewise.
21699         * xsettings.c (read_and_apply_settings): Likewise.
21701         * alloc.c (overrun_check_malloc, overrun_check_realloc)
21702         (overrun_check_free): Protoize.
21704 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
21706         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21707         since callers should never pass a negative size.
21708         Change the signature to match that of plain 'read' and 'write'; see
21709         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21710         * lisp.h: Update prototypes of emacs_write and emacs_read.
21712 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
21714         * xdisp.c (redisplay_window): Don't try to determine the character
21715         position of the scroll margin if the window start point w->startp
21716         is outside the buffer's accessible region.  (Bug#8468)
21718 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
21720         Fix write-region and its subroutines for buffers > 2GB.
21721         * fileio.c (a_write, e_write): Modify declaration of arguments and
21722         local variables to support buffers larger than 2GB.
21723         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21725         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21726         argument, local variables, and return value.
21728         * lisp.h: Update prototypes of emacs_write and emacs_read.
21730         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21732 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
21734         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21736         Fix more problems found by GCC 4.6.0's static checks.
21738         * xdisp.c (vmessage): Use a better test for character truncation.
21740         * charset.c (load_charset_map): <, not <=, for optimization,
21741         and to avoid potential problems with integer overflow.
21742         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
21743         * casetab.c (set_identity, shuffle): Likewise.
21744         * editfns.c (Fformat): Likewise.
21745         * syntax.c (skip_chars): Likewise.
21747         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21748         This also lets GCC 4.6.0 generate slightly better loop code.
21750         * callint.c (Fcall_interactively): <, not <=, for optimization.
21751         (Fcall_interactively): Count the number of arguments produced,
21752         not the number of arguments given.  This is simpler and lets GCC
21753         4.6.0 generate slightly better code.
21755         * ftfont.c: Distingish more carefully between FcChar8 and char.
21756         The previous code passed unsigned char * to a functions like
21757         strlen and xstrcasecmp that expect char *, which does not
21758         conform to the C standard.
21759         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21760         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21761         char * when the C standard requires it.
21763         * keyboard.c (read_char): Remove unused var.
21765         * eval.c: Port to Windows vsnprintf (Bug#8435).
21766         Include <limits.h>.
21767         (SIZE_MAX): Define if the headers do not.
21768         (verror): Do not give up if vsnprintf returns a negative count.
21769         Instead, grow the buffer.  This ports to Windows vsnprintf, which
21770         does not conform to C99.  Problem reported by Eli Zaretskii.
21771         Also, simplify the allocation scheme, by avoiding the need for
21772         calling realloc, and removing the ALLOCATED variable.
21774         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21776         Remove invocations of doprnt, as Emacs now uses vsnprintf.
21777         But keep the doprint source code for now, as we might revamp it
21778         and use it again (Bug#8435).
21779         * lisp.h (doprnt): Remove.
21780         * Makefile.in (base_obj): Remove doprnt.o.
21781         * deps.mk (doprnt.o): Remove.
21783         error: Print 32- and 64-bit integers portably (Bug#8435).
21784         Without this change, on typical 64-bit hosts error ("...%d...", N)
21785         was used to print both 32- and 64-bit integers N, which relied on
21786         undefined behavior.
21787         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
21788         * lisp.h (error, verror): Mark as printf-like functions.
21789         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21790         Report overflow in size calculations when allocating printf buffer.
21791         Do not truncate output string at its first null byte.
21792         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21793         Truncate the output at a character boundary, since vsnprintf does not
21794         do that.
21795         * charset.c (check_iso_charset_parameter): Convert internal
21796         character to string before calling 'error', since %c now has the
21797         printf meaning.
21798         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21799         overflow when computing char to be passed to 'error'.  Do not
21800         pass Lisp_Object to 'error'; pass the integer instead.
21801         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21802         formatted with plain %d.
21804         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21806         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21808         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21810         * xterm.c (x_catch_errors): Remove duplicate declaration.
21812         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21814         * xdisp.c, lisp.h (message_nolog): Remove; unused.
21816 2011-04-10  Jim Meyering  <meyering@redhat.com>
21818         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21819         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21820         return ssize_t not "int", and use size_t as the buffer length.
21821         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21822         * gnutls.h: Update declarations.
21823         * process.c (read_process_output): Use ssize_t, to match.
21824         (send_process): Likewise.
21826 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
21828         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21830 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
21832         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21833         Use unsigned char, to match FcChar8 type definition.
21835         * xterm.c (handle_one_xevent):
21836         * xmenu.c (create_and_show_popup_menu):
21837         * xselect.c (x_decline_selection_request)
21838         (x_reply_selection_request): Avoid type-punned deref of X events.
21840 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
21842         Fix some uses of `int' instead of EMACS_INT.
21843         * search.c (string_match_1, fast_string_match)
21844         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21845         (scan_buffer, find_next_newline_no_quit)
21846         (find_before_next_newline, search_command, Freplace_match)
21847         (Fmatch_data): Make some `int' variables be EMACS_INT.
21849         * xdisp.c (display_count_lines): 3rd argument and return value now
21850         EMACS_INT.  All callers changed.
21851         (pint2hrstr): Last argument is now EMACS_INT.
21853         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21854         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21855         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21856         (decode_coding_utf_16, decode_coding_emacs_mule)
21857         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21858         (decode_coding_ccl, decode_coding_charset)
21859         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21860         (decode_coding_iso_2022, decode_coding_emacs_mule)
21861         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21862         <char_offset, last_offset>: Declare EMACS_INT.
21863         (encode_coding_utf_8, encode_coding_utf_16)
21864         (encode_coding_emacs_mule, encode_invocation_designation)
21865         (encode_designation_at_bol, encode_coding_iso_2022)
21866         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21867         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21868         Declare EMACS_INT.
21869         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21870         (encode_invocation_designation): Last argument P_NCHARS is now
21871         EMACS_INT.
21872         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21873         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21875         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21876         All users changed.
21878         * ccl.c (Fccl_execute_on_string): Declare some variables
21879         EMACS_INT.
21881 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
21883         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21885 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
21887         * process.c (Fformat_network_address): Doc fix.
21889 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
21891         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
21893 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
21895         * keyboard.c (read_char): Call Lisp function help-form-show,
21896         instead of using internal_with_output_to_temp_buffer.
21897         (Qhelp_form_show): New var.
21898         (syms_of_keyboard): Use DEFSYM macro.
21900         * print.c (internal_with_output_to_temp_buffer): Function deleted.
21902         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21904 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
21906         * process.c (Flist_processes): Remove to Lisp.
21907         (list_processes_1): Delete.
21909 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
21911         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21913         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21915 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
21917         Fix more problems found by GCC 4.6.0's static checks.
21919         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21921         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21923         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
21925         * xdisp.c (vmessage): Mark as a printf-like function.
21927         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21929         * sound.c (sound_warning): Don't crash if arg contains a printf format.
21931         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21932         printf-like functions.
21933         (tiff_load): Add casts to remove these marks before passing them
21934         to system-supplied API.
21936         * eval.c (Fsignal): Remove excess argument to 'fatal'.
21938         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21939         This avoids several warnings with gcc -Wstrict-overflow.
21940         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21941         directly, rather than having caller test rule sign.  This avoids
21942         some unnecessary tests.
21943         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21944         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
21945         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
21947         * xfont.c (xfont_text_extents): Remove var that was set but not used.
21948         (xfont_open): Avoid unnecessary tests.
21950         * composite.c (composition_gstring_put_cache): Use unsigned integer.
21952         * composite.h, composite.c (composition_gstring_put_cache):
21953         Use EMACS_INT, not int, for length.
21955         * composite.h (COMPOSITION_DECODE_REFS): New macro,
21956         breaking out part of COMPOSITION_DECODE_RULE.
21957         (COMPOSITION_DECODE_RULE): Use it.
21958         * composite.c (get_composition_id): Remove unused local vars,
21959         by using the new macro.
21961         * textprop.c (set_text_properties_1): Change while to do-while,
21962         since the condition is always true at first.
21964         * intervals.c (graft_intervals_into_buffer): Mark var as used.
21965         (interval_deletion_adjustment): Return unsigned value.
21966         All uses changed.
21968         * process.c (list_processes_1, create_pty, read_process_output):
21969         (exec_sentinel): Remove vars that were set but not used.
21970         (create_pty): Remove unnecessary "volatile"s.
21971         (Fnetwork_interface_info): Avoid possibility of int overflow.
21972         (read_process_output): Do adaptive read buffering even if carryover.
21973         (read_process_output): Simplify nbytes computation if buffered.
21975         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21977         * syntax.c (scan_words): Remove var that was set but not used.
21978         (update_syntax_table): Use unsigned instead of int.
21980         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
21981         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
21982         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
21984         * print.c (print_error_message): Avoid int overflow.
21986         * font.c (font_list_entities): Redo for clarity,
21987         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21989         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
21990         (font_score): Avoid potential overflow in diff calculation.
21992         * fns.c (substring_both): Remove var that is set but not used.
21993         (sxhash): Redo loop for clarity and to avoid wraparound warning.
21995         * eval.c (funcall_lambda): Rename local to avoid shadowing.
21997         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21998         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21999         can always succeed if overflow has undefined behavior.
22001         * search.c (boyer_moore, wordify): Remove vars set but not used.
22002         (wordify): Omit three unnecessary tests.
22004         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22005         All callers changed.  This avoids the need for an unused var.
22007         * casefiddle.c (casify_region): Remove var that is set but not used.
22009         * dired.c (file_name_completion): Remove var that is set but not used.
22011         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22013         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
22014         (Finsert_file_contents): Remove unnecessary code checking fd.
22016         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22017         Check for integer overflow on size calculations.
22019         * buffer.c (Fprevious_overlay_change): Remove var that is set
22020         but not used.
22022         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22023         Remove vars that are set but not used.
22024         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
22025         (timer_check_2): Mark vars as initialized.
22027         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22029         * image.c (lookup_image): Remove var that is set but not used.
22030         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
22032         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22033         that are set but not used.
22035         * xfns.c (make_invisible_cursor): Don't return garbage
22036         if XCreateBitmapFromData fails (Bug#8410).
22038         * xselect.c (x_get_local_selection, x_handle_property_notify):
22039         Remove vars that are set but not used.
22041         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
22042         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
22044         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22045         Remove var that is set but not used.
22046         (scroll_bar_windows_size): Now size_t, not int.
22047         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22048         Check for overflow.
22050         * xfaces.c (realize_named_face): Remove vars that are set but not used.
22051         (map_tty_color) [!defined MSDOS]: Likewise.
22053         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22055         * coding.c: Remove vars that are set but not used.
22056         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22057         All callers changed.
22058         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22059         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22060         (decode_coding_charset): Remove vars that are set but not used.
22062         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22063         that is set but not used.
22065         * print.c (print_object): Remove var that is set but not used.
22067         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
22068         The gnulib version avoids calling malloc in the usual case,
22069         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22070         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22071         * filelock.c (current_lock_owner): Likewise.
22072         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22073         * sysdep.c: Include allocator.h, careadlinkat.h.
22074         (emacs_no_realloc_allocator): New static constant.
22075         (emacs_readlink): New function.
22076         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22077         ../lib/careadlinkat.h.
22079 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
22081         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22082         first non-nil return value).
22084 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
22086         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22087         if not defined (Bug#8403).
22089 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
22091         * xdisp.c (display_count_lines): Remove parameter `start',
22092         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
22093         (get_char_face_and_encoding): Remove parameter `multibyte_p',
22094         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
22095         (fill_stretch_glyph_string): Remove parameters `row' and `area',
22096         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22097         and thereabouts.  All callers changed.
22098         (get_per_char_metric): Remove parameter `f', unused since
22099         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
22101 2011-04-02  Jim Meyering  <meyering@redhat.com>
22103         do not dereference NULL upon failed strdup
22104         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22105         (ns_get_family): Likewise.
22107 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
22109         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22111 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
22113         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22114         later (Bug#8403).
22116 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
22118         Add lexical binding.
22120         * window.c (Ftemp_output_buffer_show): New fun.
22121         (Fsave_window_excursion):
22122         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22124         * lread.c (lisp_file_lexically_bound_p): New function.
22125         (Fload): Bind Qlexical_binding.
22126         (readevalloop): Remove `evalfun' arg.
22127         Bind Qinternal_interpreter_environment.
22128         (Feval_buffer): Bind Qlexical_binding.
22129         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22130         Mark as dynamic.
22131         (syms_of_lread): Declare `lexical-binding'.
22133         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22135         * keyboard.c (eval_dyn): New fun.
22136         (menu_item_eval_property): Use it.
22138         * image.c (parse_image_spec): Use Ffunctionp.
22140         * fns.c (concat, mapcar1): Accept byte-code-functions.
22142         * eval.c (Fsetq): Handle lexical vars.
22143         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22144         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22145         (FletX, Flet): Obey lexical binding.
22146         (Fcommandp): Handle closures.
22147         (Feval): New `lexical' arg.
22148         (eval_sub): New function extracted from Feval.  Use it almost
22149         everywhere where Feval was used.  Look up vars in lexical env.
22150         Handle closures.
22151         (Ffunctionp): Move from subr.el.
22152         (Ffuncall): Handle closures.
22153         (apply_lambda): Remove `eval_flags'.
22154         (funcall_lambda): Handle closures and new byte-code-functions.
22155         (Fspecial_variable_p): New function.
22156         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22157         but without exporting it to Lisp.
22159         * doc.c (Fdocumentation, store_function_docstring):
22160         * data.c (Finteractive_form): Handle closures.
22162         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22163         interactive spec.
22165         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22166         New byte-codes.
22167         (exec_byte_code): New function extracted from Fbyte_code to handle new
22168         calling convention for byte-code-functions.  Add new byte-codes.
22170         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
22172         * alloc.c (Fmake_symbol): Init new `declared_special' field.
22174 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
22176         * xdisp.c (redisplay_internal): Fix prototype.
22178 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
22180         * xdisp.c (SCROLL_LIMIT): New macro.
22181         (try_scrolling): Use it when setting scroll_limit.
22182         Limit scrolling to 100 screen lines.
22183         (redisplay_window): Even when falling back on "recentering",
22184         position point in the window according to scroll-conservatively,
22185         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
22187         (try_scrolling): When point is above the window, allow searching
22188         as far as scroll_max, or one screenful, to compute vertical
22189         distance from PT to the scroll margin position.  This prevents
22190         try_scrolling from unnecessarily failing when
22191         scroll-conservatively is set to a value slightly larger than the
22192         window height.  Clean up the case of PT below the margin at bottom
22193         of window: scroll_max can no longer be INT_MAX.  When aggressive
22194         scrolling is in use, don't let point enter the opposite scroll
22195         margin as result of the scroll.
22196         (syms_of_xdisp) <scroll-conservatively>: Document the
22197         threshold of 100 lines for never-recentering scrolling.
22199 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
22201         * dispextern.h (move_it_by_lines):
22202         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22203         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
22204         (message_log_check_duplicate): Remove parameters `prev_bol' and
22205         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
22206         (redisplay_internal): Remove parameter `preserve_echo_area',
22207         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
22209         * indent.c (Fvertical_motion):
22210         * window.c (window_scroll_pixel_based, Frecenter):
22211         Don't pass `need_y_p' to `move_it_by_lines'.
22213 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
22215         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22216         steal a few bits to be more compact.
22217         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22218         Remove unneeded casts.
22220         * bytecode.c (Fbyte_code): CAR and CDR can GC.
22222 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
22224         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22225         binding" message (bug#7967).
22227 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
22229         Fix more problems found by GCC 4.6.0's static checks.
22231         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22232         Remove unused local var.
22234         * editfns.c (Fmessage_box): Remove unused local var.
22236         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22237         (note_mode_line_or_margin_highlight, note_mouse_highlight):
22238         Omit unused local vars.
22239         * window.c (shrink_windows): Omit unused local var.
22240         * menu.c (digest_single_submenu): Omit unused local var.
22241         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22242         Omit unused local var.
22244         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22245         Don't assume string length fits in int.
22246         (keyremap_step, read_key_sequence): Use size_t for sizes.
22247         (read_key_sequence): Don't check last_real_key_start redundantly.
22249         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22250         instead of alloca (Bug#8344).
22252         * eval.c (Fbacktrace): Don't assume nargs fits in int.
22253         (Fbacktrace_frame): Don't assume nframes fits in int.
22255         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22257         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22258         concerns.
22260         * term.c (produce_glyphless_glyph): Remove unnecessary test.
22262         * cm.c (calccost): Turn while-do into do-while, for clarity.
22264         * keyboard.c (syms_of_keyboard): Use the same style as later
22265         in this function when indexing through an array.  This also
22266         works around GCC bug 48267.
22268         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22270         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22272         * chartab.c (sub_char_table_ref_and_range): Redo for slight
22273         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22275         * keyboard.c, keyboard.h (num_input_events): Now size_t.
22276         This avoids undefined behavior on integer overflow, and is a bit
22277         more convenient anyway since it is compared to a size_t variable.
22279         Variadic C functions now count arguments with size_t, not int.
22280         This avoids an unnecessary limitation on 64-bit machines, which
22281         caused (substring ...) to crash on large vectors (Bug#8344).
22282         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22283         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
22284         All variadic functions and their callers changed accordingly.
22285         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
22286         * data.c (arith_driver, float_arith_driver): Likewise.
22287         * editfns.c (general_insert_function): Likewise.
22288         * eval.c (struct backtrace.nargs, interactive_p)
22289         (internal_condition_case_n, run_hook_with_args, apply_lambda)
22290         (funcall_lambda, mark_backtrace): Likewise.
22291         * fns.c (concat): Likewise.
22292         * frame.c (x_set_frame_parameters): Likewise.
22293         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22294         0 if not found, not -1.  All callers changed.
22296         * alloc.c (garbage_collect): Don't assume stack size fits in int.
22297         (stack_copy_size): Now size_t, not int.
22298         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22300 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
22302         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22303         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22304         All callers changed.
22306         * lisp.h (multibyte_char_to_unibyte):
22307         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22308         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22309         * character.h (CHAR_TO_BYTE8):
22310         * cmds.c (internal_self_insert):
22311         * editfns.c (general_insert_function):
22312         * keymap.c (push_key_description):
22313         * search.c (Freplace_match):
22314         * xdisp.c (message_dolog, set_message_1): All callers changed.
22316 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
22318         * keyboard.c (safe_run_hook_funcall): New function.
22319         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22320         don't set the hook to nil, but remove the offending function instead.
22321         (Qcommand_hook_internal): Remove, unused.
22322         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22323         Vcommand_hook_internal.
22325         * eval.c (enum run_hooks_condition): Remove.
22326         (funcall_nil, funcall_not): New functions.
22327         (run_hook_with_args): Call each function through a `funcall' argument.
22328         Remove `cond' argument, now redundant.
22329         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22330         (Frun_hook_with_args_until_failure): Adjust accordingly.
22331         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22333 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
22335         * dispextern.h (string_buffer_position): Remove declaration.
22337         * print.c (strout): Remove parameter `multibyte', unused since
22338         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
22340         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22341         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22342         All callers changed.
22344         * w32.c (_wsa_errlist): Use braces for struct initializers.
22346         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22347         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22348         All callers changed.
22349         (string_buffer_position): Likewise.  Also, make static (it's never
22350         used outside xdisp.c).
22351         (cursor_row_p): Remove parameter `w', unused since
22352         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
22353         (decode_mode_spec): Remove parameter `precision', introduced during
22354         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22355         All callers changed.
22357 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
22359         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22361 2011-03-27  Anders Lindgren  <andlind@gmail.com>
22363         * nsterm.m (ns_menu_bar_is_hidden): New variable.
22364         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22365         (ns_update_auto_hide_menu_bar): New functions.
22366         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22367         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22368         ns_constrain_all_frames.
22369         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22370         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22372 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
22374         * nsmenu.m (runDialogAt): Remove argument to timer_check.
22376 2011-03-27  Glenn Morris  <rgm@gnu.org>
22378         * syssignal.h: Replace RETSIGTYPE with void.
22379         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22380         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22381         Replace SIGTYPE with void everywhere.
22382         * s/usg5-4-common.h (SIGTYPE): Remove definition.
22383         * s/template.h (SIGTYPE): Remove commented out definition.
22385 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
22387         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22388         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
22390 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
22392         * w32.c (read_unc_volume): Use parameter `henum', instead of
22393         global variable `wget_enum_handle'.
22395         * keymap.c (describe_vector): Remove parameters `indices' and
22396         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22397         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22399         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22401         * keyboard.c (timer_check): Remove parameter `do_it_now',
22402         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22403         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22404         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22406         * keyboard.c (read_char):
22407         * w32menu.c (w32_menu_display_help):
22408         * xmenu.c (show_help_event, menu_help_callback):
22409         Adjust calls to `show_help_echo'.
22411         * gtkutil.c (xg_maybe_add_timer):
22412         * keyboard.c (readable_events):
22413         * process.c (wait_reading_process_output):
22414         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22416         * insdel.c (adjust_markers_gap_motion):
22417         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22418         (gap_left, gap_right): Don't call it.
22420 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
22422         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22423         incurred during fontification.
22425 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
22427         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22428         (DEFVAR_PER_BUFFER): Don't pass it.
22430         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22431         (scrolling_window): Don't pass it.
22433 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
22435         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22437         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22438         and `suffix'.
22439         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22440         of variables specific to SELinux and computation of `encoded_absname'.
22442         * image.c (XPutPixel): Remove unused variable `height'.
22444         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22446         * unexw32.c (get_section_info): Remove unused variable `section'.
22448         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22449         (system_process_attributes): Remove unused variable `sess'.
22450         (sys_read): Remove unused variable `err'.
22452         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22453         (w32_wnd_proc): Remove unused variable `isdead'.
22454         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22455         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22456         (x_create_tip_frame): Remove unused variable `tem'.
22458         * w32inevt.c (w32_console_read_socket):
22459         Remove unused variable `no_events'.
22461         * w32term.c (x_draw_composite_glyph_string_foreground):
22462         Remove unused variable `width'.
22464 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
22466         * w32term.c (x_set_glyph_string_clipping):
22467         Don't pass uninitialized region to CombineRgn.
22469 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
22471         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22472         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22473         (Fx_close_connection): Remove unused variable `i'.
22475         * w32font.c (w32font_draw): Return number of glyphs.
22476         (w32font_open_internal): Remove unused variable `i'.
22477         (w32font_driver): Add missing initializer.
22479         * w32menu.c (utf8to16): Remove unused variable `utf16'.
22480         (fill_in_menu): Remove unused variable `items_added'.
22482         * w32term.c (last_mouse_press_frame): Remove static global variable.
22483         (w32_clip_to_row): Remove unused variable `f'.
22484         (x_delete_terminal): Remove unused variable `i'.
22486         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22487         (NOTHING): Remove unused static global variable.
22488         (uniscribe_check_otf): Remove unused variable `table'.
22489         (uniscribe_font_driver): Add missing initializers.
22491 2011-03-23  Julien Danjou  <julien@danjou.info>
22493         * term.c (Fsuspend_tty, Fresume_tty):
22494         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22495         * window.c (temp_output_buffer_show):
22496         * insdel.c (signal_before_change):
22497         * frame.c (Fhandle_switch_frame):
22498         * fileio.c (Fdo_auto_save):
22499         * emacs.c (Fkill_emacs):
22500         * editfns.c (save_excursion_restore):
22501         * cmds.c (internal_self_insert):
22502         * callint.c (Fcall_interactively):
22503         * buffer.c (Fkill_all_local_variables):
22504         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22505         Use Frun_hooks.
22506         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
22507         unconditionally since it does the check itself.
22509 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
22511         Fix more problems found by GCC 4.5.2's static checks.
22513         * coding.c (encode_coding_raw_text): Avoid unnecessary test
22514         the first time through the loop, since we know p0 < p1 then.
22515         This also avoids a gcc -Wstrict-overflow warning.
22517         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22518         leading to a memory leak, possible in functions like
22519         load_charset_map_from_file that can allocate an unbounded number
22520         of objects (Bug#8318).
22522         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22523         that could (at least in theory) be that large.
22525         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22526         This is less likely to overflow, and avoids undefined behavior if
22527         overflow does occur.  All callers changed.  Use strtoul to scan
22528         for the unsigned long integer.
22529         (pint2hrstr): Simplify and tune code slightly.
22530         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
22532         * scroll.c (do_scrolling): Work around GCC bug 48228.
22533         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22535         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22536         This also avoids a warning with gcc -Wstrict-overflow.
22537         (validate_x_resource_name): Simplify count usage.
22538         This also avoids a warning with gcc -Wstrict-overflow.
22540         * fileio.c (Fcopy_file): Report error if fchown or fchmod
22541         fail (Bug#8306).
22543         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
22545         * process.c (Fmake_network_process): Use socklen_t, not int,
22546         where POSIX says socklen_t is required in portable programs.
22547         This fixes a porting bug on hosts like 64-bit HP-UX, where
22548         socklen_t is wider than int (Bug#8277).
22549         (Fmake_network_process, server_accept_connection):
22550         (wait_reading_process_output, read_process_output):
22551         Likewise.
22553         * process.c: Rename or move locals to avoid shadowing.
22554         (list_processes_1, Fmake_network_process):
22555         (read_process_output_error_handler, exec_sentinel_error_handler):
22556         Rename or move locals.
22557         (Fmake_network_process): Define label "retry_connect" only if needed.
22558         (Fnetwork_interface_info): Fix pointer signedness.
22559         (process_send_signal): Add cast to avoid pointer signedness problem.
22560         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
22561         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
22563         Make tparam.h and terminfo.c consistent.
22564         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22565         Include tparam.h instead, since it declares them.
22566         * cm.h (PC): Remove extern decl; tparam.h now does this.
22567         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22568         * terminfo.c: Include tparam.h, to check interfaces.
22569         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
22570         (tparam): Adjust signature to match interface in tparam.h;
22571         this removes some undefined behavior.  Check that outstring and len
22572         are zero, which they always are with Emacs.
22573         * tparam.h (PC, BC, UP): New extern decls.
22575         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
22576         (xftfont_open): Rename locals to avoid shadowing.
22578         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
22579         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22580         (OTF_TAG_SYM): Omit macro if not needed.
22581         (ftfont_list): Remove unused local.
22582         (get_adstyle_property, ftfont_pattern_entity):
22583         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22584         Rename locals to avoid shadowing.
22586         * xfont.c (xfont_list_family): Mark var as initialized.
22588         * xml.c (make_dom): Now static.
22590         * composite.c (composition_compute_stop_pos): Rename local to
22591         avoid shadowing.
22592         (composition_reseat_it): Remove unused locals.
22593         (find_automatic_composition, composition_adjust_point): Likewise.
22594         (composition_update_it): Mark var as initialized.
22595         (find_automatic_composition): Mark vars as initialized,
22596         with a FIXME (Bug#8290).
22598         character.h: Rename locals to avoid shadowing.
22599         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22600         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22601         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22602         (BUF_DEC_POS): Be more systematic about renaming local temporaries
22603         to avoid shadowing.
22605         * textprop.c (property_change_between_p): Remove; unused.
22607         * intervals.c (interval_start_pos): Now static.
22609         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22611         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22612         Rename locals to avoid shadowing.
22614         * sound.c (wav_play, au_play, Fplay_sound_internal):
22615         Fix pointer signedness.
22616         (alsa_choose_format): Remove unused local var.
22617         (wav_play): Initialize a variable to 0, to prevent undefined
22618         behavior (Bug#8278).
22620         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22622         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22624         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22625         clobbering (Bug#8298).
22626         * sysdep.c (sys_subshell): Likewise.
22627         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
22629         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22630         This should get cleaned up, so that child_setup has the
22631         same signature on all platforms.
22633         * callproc.c (call_process_cleanup): Now static.
22634         (relocate_fd): Rename locals to avoid shadowing.
22636 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
22638         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
22639         not to be necessary, and produces flickering.
22641 2011-03-20  Glenn Morris  <rgm@gnu.org>
22643         * config.in: Remove file.
22645 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
22647         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22648         are now in src/globals.h.
22649         (syms_of_minibuf): Remove spurious & from previous change.
22651 2011-03-20  Leo Liu  <sdl.web@gmail.com>
22653         * minibuf.c (completing-read-function): New variable.
22654         (completing-read-default): Rename from completing-read.
22655         (completing-read): Call completing-read-function.
22657 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
22659         * xfaces.c (Fx_load_color_file):
22660         Read color file from absolute filename (bug#8250).
22662 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
22664         * makefile.w32-in: Update dependencies.
22666 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
22668         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22670 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
22672         Fix more problems found by GCC 4.5.2's static checks.
22674         * process.c (make_serial_process_unwind, send_process_trap):
22675         (sigchld_handler): Now static.
22677         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22678         That way, the code declares only the vars that it needs.
22679         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22680         * s/cygwin.h (PTY_ITERATION): Likewise.
22681         * s/darwin.h (PTY_ITERATION): Likewise.
22682         * s/gnu-linux.h (PTY_ITERATION): Likewise.
22684         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22685         * process.c (allocate_pty): Don't declare stb unless it's needed.
22687         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
22688         (CONSTANTLIM): Remove; unused.
22689         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22690         Define only if needed.
22692         * unexelf.c (unexec): Name an expression,
22693         to avoid gcc -Wbad-function-cast warning.
22694         Use a different way to cause a compilation error if anyone uses
22695         n rather than nn, a way that does not involve shadowing.
22696         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
22698         * deps.mk (unexalpha.o): Remove; unused.
22700         New file unexec.h, the (simple) interface for unexec (Bug#8267).
22701         * unexec.h: New file.
22702         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22703         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22704         Depend on unexec.h.
22705         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22706         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22707         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
22708         Change as necessary to match prototype in unexec.h.
22710         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22711         shadowing.
22712         (back_comment, skip_chars): Mark vars as initialized.
22714         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22715         Rename locals to avoid shadowing.
22717         * lread.c (read1): Rewrite so as not to use empty "else".
22718         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
22720         * print.c (Fredirect_debugging_output): Fix pointer signedess.
22722         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22723         warning when compiling print.c.
22725         * font.c (font_unparse_fcname): Abort in an "impossible" situation
22726         instead of using an uninitialized var.
22727         (font_sort_entities): Mark var as initialized.
22729         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22731         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22732         pointers to constants.
22733         (font_parse_fcname): Remove unused vars.
22734         (font_delete_unmatched): Now static.
22735         (font_get_spec): Remove; unused.
22736         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22737         (font_update_drivers, Ffont_get_glyphs, font_add_log):
22738         Rename or move locals to avoid shadowing.
22740         * fns.c (require_nesting_list, require_unwind): Now static.
22741         (Ffillarray): Rename locals to avoid shadowing.
22743         * floatfns.c (domain_error2): Define only if needed.
22744         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
22746         * alloc.c (mark_backtrace): Move decl from here ...
22747         * lisp.h: ... to here, so that it can be checked.
22749         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
22750         (Fdefvar): Rewrite so as not to use empty "else".
22751         (lisp_indirect_variable): Name an expression,
22752         to avoid gcc -Wbad-function-cast warning.
22753         (Fdefvar): Rename locals to avoid shadowing.
22755         * callint.c (quotify_arg, quotify_args): Now static.
22756         (Fcall_interactively): Rename locals to avoid shadowing.
22757         Use const pointer when appropriate.
22759         * lisp.h (get_system_name, get_operating_system_release):
22760         Move decls here, to check interfaces.
22761         * process.c (get_operating_system_release): Move decl to lisp.h.
22762         * xrdb.c (get_system_name): Likewise.
22763         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22764         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22765         some of which prompt warnings from gcc -Wbad-function-cast.
22766         (Fformat_time_string, Fencode_time, Finsert_char):
22767         (Ftranslate_region_internal, Fformat):
22768         Rename or remove local vars to avoid shadowing.
22769         (Ftranslate_region_internal): Mark var as initialized.
22771         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22772         avoid shadowing.
22774         * lisp.h (eassert): Check that the argument compiles, even if
22775         ENABLE_CHECKING is not defined.
22777         * data.c (Findirect_variable): Name an expression, to avoid
22778         gcc -Wbad-function-cast warning.
22779         (default_value, arithcompare, arith_driver, arith_error): Now static.
22780         (store_symval_forwarding): Rename local to avoid shadowing.
22781         (Fmake_variable_buffer_local, Fmake_local_variable):
22782         Mark variables as initialized.
22783         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
22785         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
22786         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22787         Rename locals to avoid shadowing.
22788         (mark_stack): Move local variables into the #ifdef region where
22789         they're used.
22790         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22791         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22792         needed otherwise.
22793         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22794         (GC_STRING_CHARS): Remove; not used.
22795         (Fmemory_limit): Cast sbrk's returned value to char *.
22797         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22798         avoids undefined behavior in theory.
22800         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22802         Use functions, not macros, for up- and down-casing (Bug#8254).
22803         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22804         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
22805         to use the following functions instead of these macros.
22806         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
22807         EMACS_INT, since callers assume the returned value fits in int.
22808         (upcase1): Likewise, for UPCASE_TABLE.
22809         (uppercasep, lowercasep, upcase): New static inline functions.
22810         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
22811         the race-condition problem in the old DOWNCASE.
22813         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22814         Rename locals to avoid shadowing.
22815         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
22816         (regex_compile, re_search_2, re_match_2_internal):
22817         Remove unused local vars.
22818         (FREE_VAR): Rewrite so as not to use empty "else",
22819         which gcc can warn about.
22820         (regex_compile, re_match_2_internal): Mark locals as initialized.
22821         (RETALLOC_IF): Define only if needed.
22822         (WORDCHAR_P): Likewise.  This one is never needed, but is used
22823         only in a comment talking about a compiler bug, so put inside
22824         the #if 0 of that comment.
22825         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22826         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22827         Remove; unused.
22829         * search.c (boyer_moore): Rename locals to avoid shadowing.
22830         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22831         (PREV_CHAR_BOUNDARY): Likewise.
22833         * search.c (simple_search): Remove unused var.
22835         * dired.c (compile_pattern): Move decl from here ...
22836         * lisp.h: ... to here, so that it can be checked.
22837         (struct re_registers): New forward decl.
22839         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22841         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22842         All uses changed.
22843         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22844         Rename locals to avoid shadowing.
22845         (Fvertical_motion): Mark locals as initialized.
22847         * casefiddle.c (casify_object, casify_region): Now static.
22848         (casify_region): Mark local as initialized.
22850         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22852         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22853         New macros, so that the caller can use some names other than
22854         gcpro1, gcpro2, etc.
22855         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22856         of the new macros.
22857         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22858         argument, for consistency with GCPRO2_VAR, etc: it is now the
22859         prefix of the variable, not the variable itself.  All uses
22860         changed.
22861         * dired.c (directory_files_internal, file_name_completion):
22862         Rename locals to avoid shadowing.
22864         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22865         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22866         dired.c's scmp function, had undefined behavior.
22867         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22868         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22869         * buffer.h: ... to here, because these macros use current_buffer,
22870         and the new implementation with inline functions needs to have
22871         current_buffer in scope now, rather than later when the macros
22872         are used.
22873         (downcase, upcase1): New static inline functions.
22874         (DOWNCASE, UPCASE1): Reimplement using these functions.
22875         This avoids undefined behavior in expressions like
22876         DOWNCASE (x) == DOWNCASE (y), which previously suffered
22877         from race conditions in accessing the global variables
22878         case_temp1 and case_temp2.
22879         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22880         * lisp.h (case_temp1, case_temp2): Remove their decls.
22881         * character.h (ASCII_CHAR_P): Move from here ...
22882         * lisp.h: ... to here, so that the inline functions mentioned
22883         above can use them.
22885         * dired.c (directory_files_internal_unwind): Now static.
22887         * fileio.c (file_name_as_directory, directory_file_name):
22888         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22889         Now static.
22890         (file_name_as_directory): Use const pointers when appropriate.
22891         (Fexpand_file_name): Likewise.  In particular, newdir might
22892         point at constant storage, so make it a const pointer.
22893         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
22894         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22895         signedness issues.
22896         (Fset_file_times, Finsert_file_contents, auto_save_error):
22897         Rename locals to avoid shadowing.
22899         * minibuf.c (choose_minibuf_frame_1): Now static.
22900         (Ftry_completion, Fall_completions): Rename or remove locals
22901         to avoid shadowing.
22903         * marker.c (bytepos_to_charpos): Remove; unused.
22905         * lisp.h (verify_bytepos, count_markers): New decls,
22906         so that gcc does not warn that these functions aren't declared.
22908         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22909         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
22910         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
22911         (copy_text): Remove unused local var.
22913         * filelock.c (within_one_second): Now static.
22914         (lock_file_1): Rename local to avoid shadowing.
22916         * buffer.c (fix_overlays_before): Mark locals as initialized.
22917         (fix_start_end_in_overlays): Likewise.  This function should be
22918         simplified by using pointers-to-pointers, but that's a different
22919         matter.
22920         (switch_to_buffer_1): Now static.
22921         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22922         (report_overlay_modification): Rename locals to avoid shadowing.
22924         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
22925         Fix pointer signedness issue.
22926         (sys_subshell): Mark local as volatile if checking for lint,
22927         to suppress a gcc -Wclobbered warning that does not seem to be right.
22928         (MAXPATHLEN): Define only if needed.
22930         * process.c (serial_open, serial_configure): Move decls from here ...
22931         * systty.h: ... to here, so that they can be checked.
22933         * fns.c (get_random, seed_random): Move extern decls from here ...
22934         * lisp.h: ... to here, so that they can be checked.
22936         * sysdep.c (reset_io): Now static.
22937         (wait_for_termination_signal): Remove; unused.
22939         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22940         (copy_keymap_item, append_key, push_text_char_description):
22941         Now static.
22942         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
22943         (DENSE_TABLE_SIZE): Remove; unused.
22944         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22945         (describe_map_tree):
22946         Rename locals to avoid shadowing.
22948         * keyboard.c: Declare functions static if they are not used elsewhere.
22949         (echo_char, echo_dash, cmd_error, top_level_2):
22950         (poll_for_input, handle_async_input): Now static.
22951         (read_char, kbd_buffer_get_event, make_lispy_position):
22952         (make_lispy_event, make_lispy_movement, apply_modifiers):
22953         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22954         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22955         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
22956         (read_key_sequence, read_char): Mark locals as initialized.
22957         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
22959         * keyboard.h (make_ctrl_char): New decl.
22960         (mark_kboards): Move decl here ...
22961         * alloc.c (mark_kboards): ... from here.
22963         * lisp.h (force_auto_save_soon): New decl.
22965         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
22966         (DEFINE_DUMMY_FUNCTION): New macro.
22967         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22968         Use it.
22969         (main): Add casts to avoid warnings
22970         if GCC considers string literals to be constants.
22972         * lisp.h (fatal_error_signal): Add decl, since it's exported.
22974         * dbusbind.c: Pointer signedness fixes.
22975         (xd_signature, xd_append_arg, xd_initialize):
22976         (Fdbus_call_method, Fdbus_call_method_asynchronously):
22977         (Fdbus_method_return_internal, Fdbus_method_error_internal):
22978         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22979         (Fdbus_register_signal): Use SSDATA when the context wants char *.
22981         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22982         if GCC considers string literals to be constants.
22983         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
22985 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
22987         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22988         (print_preprocess, print_object): New macro to fix last change.
22990         * print.c (print_preprocess): Don't forget font objects.
22992 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
22994         * emacs.c (USAGE3): Doc fixes.
22996 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
22998         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22999         structure.
23001 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
23003         * lisp.h (VWindow_system, Qfile_name_history):
23004         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23005         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23006         (w32_system_caret_x, w32_system_caret_y): Declare extern.
23008         * w32select.c: Don't #include "keyboard.h".
23009         (run_protected): Add extern declaration for waiting_for_input.
23011         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23012         * w32console.c (detect_input_pending, read_input_pending)
23013         (encode_terminal_code):
23014         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23015         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23016         (w32_system_caret_y, Qfile_name_history):
23017         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23018         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23019         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23020         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23021         * w32proc.c (Qlocal, report_file_error):
23022         * w32term.c (Vwindow_system, updating_frame):
23023         * w32uniscribe.c (initialized, uniscribe_font_driver):
23024         Remove unneeded extern declarations.
23026 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
23028         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
23030 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
23032         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23033         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23034         These macros can no longer be used for assignment.
23036         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23037         Assign struct members directly, instead of using BUF_BEGV etc.
23038         (record_buffer_markers, fetch_buffer_markers): New functions for
23039         recording and fetching special buffer markers.
23040         (set_buffer_internal_1, set_buffer_temp): Use them.
23042         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23044         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23046         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23047         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23049         * xdisp.c (hscroll_window_tree):
23050         (reconsider_clip_changes): Use PT instead of BUF_PT.
23052 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
23054         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23055         $(EMACS_ROOT)/lib/intprops.h.
23057 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
23059         Fix more problems found by GCC 4.5.2's static checks.
23061         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23062         to unsigned char * to avoid compiler diagnostic.
23063         (xg_free_frame_widgets): Make it clear that a local variable is
23064         needed only if USE_GTK_TOOLTIP.
23065         (gdk_window_get_screen): Make it clear that this macro is needed
23066         only if USE_GTK_TOOLTIP.
23067         (int_gtk_range_get_value): New function, which avoids a diagnostic
23068         from gcc -Wbad-function-cast.
23069         (xg_set_toolkit_scroll_bar_thumb): Use it.
23070         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23071         diagnostic from gcc -Wbad-function-cast.
23072         (get_utf8_string, xg_get_file_with_chooser):
23073         Rename locals to avoid shadowing.
23074         (create_dialog): Move locals to avoid shadowing.
23076         * xgselect.c (xg_select): Remove unused var.
23078         * image.c (four_corners_best): Mark locals as initialized.
23079         (gif_load): Initialize transparent_p to zero (Bug#8238).
23080         Mark another local as initialized.
23081         (my_png_error, my_error_exit): Mark with NO_RETURN.
23083         * image.c (clear_image_cache): Now static.
23084         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
23085         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
23086         (x_edge_detection): Remove unnecessary cast that
23087         gcc -Wbad-function-cast diagnoses.
23088         (gif_load): Fix pointer signedness.
23089         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23090         (jpeg_load, gif_load): Rename locals to avoid shadowing.
23092 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
23094         Improve quality of tests for time stamp overflow.
23095         For example, without this patch (encode-time 0 0 0 1 1
23096         1152921504606846976) returns the obviously-bogus value (-948597
23097         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
23098         reports time overflow.  See
23099         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
23100         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23101         * editfns.c: Include limits.h and intprops.h.
23102         (TIME_T_MIN, TIME_T_MAX): New macros.
23103         (time_overflow): Move earlier, to before first use.
23104         (hi_time, lo_time): New functions, for an accurate test for
23105         out-of-range times.
23106         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23107         (Fget_internal_run_time): Don't assume time_t fits in int.
23108         (make_time): Use list2 instead of Fcons twice.
23109         (Fdecode_time): More accurate test for out-of-range times.
23110         (check_tm_member): New function.
23111         (Fencode_time): Use it, to test for out-of-range times.
23112         (lisp_time_argument): Don't rely on undefined left-shift and
23113         right-shift behavior when checking for time stamp overflow.
23115         * editfns.c (time_overflow): New function, refactoring common code.
23116         (Fformat_time_string, Fdecode_time, Fencode_time):
23117         (Fcurrent_time_string): Use it.
23119         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23120         * dired.c (make_time): Move to ...
23121         * editfns.c (make_time): ... here.
23122         * systime.h: Note the move.
23124 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
23126         * fringe.c (update_window_fringes): Remove unused variables.
23128         * unexmacosx.c (copy_data_segment): Also copy __got section.
23129         (Bug#8223)
23131 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
23133         * termcap.c [MSDOS]: Include "msdos.h".
23134         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23135         Constify `char *' arguments and their references according to
23136         prototypes in tparam.h.
23138         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
23140         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23141         Adapt all references accordingly.
23143         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23145 2011-03-11  Tom Tromey  <tromey@redhat.com>
23147         * buffer.c (syms_of_buffer): Remove obsolete comment.
23149 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
23151         * termhooks.h (encode_terminal_code): Declare prototype.
23153         * msdos.c (encode_terminal_code): Don't declare prototype.
23155         * term.c (encode_terminal_code): Now external again, used by
23156         w32console.c and msdos.c.
23158         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23159         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
23161 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
23163         Fix some minor problems found by GCC 4.5.2's static checks.
23165         * fringe.c (update_window_fringes): Mark locals as initialized
23166         (Bug#8227).
23167         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
23169         * alloc.c (mark_fringe_data): Move decl from here ...
23170         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23171         to check its interface.
23172         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23174         * fontset.c (free_realized_fontset): Now static.
23175         (Fset_fontset_font): Rename local to avoid shadowing.
23176         (fontset_font): Mark local as initialized.
23177         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
23179         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23181         * xselect.c (x_disown_buffer_selections): Remove; not used.
23182         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
23183         (x_own_selection, Fx_disown_selection_internal): Rename locals
23184         to avoid shadowing.
23185         (x_handle_dnd_message): Remove local to avoid shadowing.
23187         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23188         so that the caller can use some name other than gcpro1.
23189         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
23190         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23191         (Fx_backspace_delete_keys_p):
23192         Use them to avoid shadowing, and rename vars to avoid shadowing.
23193         (x_decode_color, x_set_name, x_window): Now static.
23194         (Fx_create_frame): Add braces to silence GCC warning.
23195         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
23196         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23197         Remove unused locals.
23198         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23199         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23200         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23201         macros.
23203         * xterm.h (x_mouse_leave): New decl.
23205         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23206         Remove unused functions.
23207         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23208         (x_calc_absolute_position): Now static.
23209         (XTread_socket): Don't define label "out" unless it's used.
23210         Don't declare local "event" unless it's used.
23211         (x_iconify_frame, x_free_frame_resources): Don't declare locals
23212         unless they are used.
23213         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23214         (x_fatal_error_signal): Remove; not used.
23215         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23216         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23217         (x_error_catcher, x_connection_closed, x_error_handler):
23218         (x_error_quitter, xembed_send_message, x_iconify_frame):
23219         (my_log_handler): Rename locals to avoid shadowing.
23220         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
23221         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
23223         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23224         Rename or move locals to avoid shadowing.
23225         (tty_defined_color, merge_face_heights): Now static.
23226         (free_realized_faces_for_fontset): Remove; not used.
23227         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23228         does not deduce is never used uninitialized.
23229         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23230         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
23232         * terminal.c (store_terminal_param): Now static.
23234         * xmenu.c (menu_highlight_callback): Now static.
23235         (set_frame_menubar): Remove unused local.
23236         (xmenu_show): Rename parameter to avoid shadowing.
23237         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23238         since they might point to immutable storage.
23239         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23240         since it's unused otherwise.
23242         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
23243         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
23244         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23245         avoids a gcc -Wuninitialized diagnostic.
23246         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
23247         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23248         does not deduce are never used uninitialized.
23250         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23252         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
23253         * window.c (window_loop, size_window):
23254         (run_window_configuration_change_hook, enlarge_window): Likewise.
23256         * window.c (display_buffer): Now static.
23257         (size_window): Mark variables that gcc -Wuninitialized
23258         does not deduce are never used uninitialized.
23259         * window.h (check_all_windows): New decl, to forestall
23260         gcc -Wmissing-prototypes diagnostic.
23261         * dispextern.h (bidi_dump_cached_states): Likewise.
23263         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23264         shadowing.
23265         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
23266         Include <limits.h>.
23267         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23268         and to avoid gcc -Wuninitialized warning.
23269         (load_charset_map): Mark variables that gcc -Wuninitialized
23270         does not deduce are never used uninitialized.
23271         (load_charset): Abort instead of using uninitialized var (Bug#8229).
23273         * coding.c (coding_set_source, coding_set_destination):
23274         Use "else { /* comment */ }" rather than "else /* comment */;"
23275         for clarity, and to avoid gcc -Wempty-body warning.
23276         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23277         a block, when the outer 'i' will do.
23278         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23279         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23280         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23281         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23282         (Fdecode_sjis_char, Fdefine_coding_system_internal):
23283         Rename locals to avoid shadowing.
23284         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
23285         * coding.c (emacs_mule_char, encode_invocation_designation):
23286         Now static, since they're not used elsewhere.
23287         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
23288         (decode_coding_object, encode_coding_object, detect_coding_system):
23289         (decode_coding_emacs_mule): Mark variables that gcc
23290         -Wuninitialized does not deduce are never used uninitialized.
23291         (detect_coding_iso_2022): Initialize a local variable that might
23292         be used uninitialized.  Leave a FIXME because it's not clear that
23293         this initialization is needed.  (Bug#8211)
23294         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23295         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23296         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23297         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23298         Remove unused macros.
23300         * category.c (hash_get_category_set): Remove unused local var.
23301         (copy_category_table): Now static, since it's not used elsewhere.
23302         * character.c (string_count_byte8): Likewise.
23304         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23305         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23307         * chartab.c (copy_sub_char_table): Now static, since it's not used
23308         elsewhere.
23309         (sub_char_table_ref_and_range, char_table_ref_and_range):
23310         Rename locals to avoid shadowing.
23311         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
23313         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
23314         (BIDI_BOB): Remove unused macro.
23316         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23317         deduce are never used uninitialized.
23318         * term.c (encode_terminal_code): Likewise.
23320         * term.c (encode_terminal_code): Now static.  Remove unused local.
23322         * tparam.h: New file.
23323         * term.c, tparam.h: Include it.
23324         * deps.mk (term.o, tparam.o): Depend on tparam.h.
23325         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23326         Move these decls to tparam.h, and make them agree with what
23327         is actually in tparam.c.  The previous trick of using incompatible
23328         decls in different modules does not conform to the C standard.
23329         All callers of tparam changed to use tparam's actual API.
23330         * tparam.c (tparam1, tparam, tgoto):
23331         Use const pointers where appropriate.
23333         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23334         * cm.h (struct cm): Likewise.
23335         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23336         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23337         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23338         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23339         (turn_on_face, init_tty): Likewise.
23340         * termchar.h (struct tty_display_info): Likewise.
23342         * term.c (term_mouse_position): Rename local to avoid shadowing.
23344         * alloc.c (mark_ttys): Move decl from here ...
23345         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23347 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
23349         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23351 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
23353         * search.c (compile_pattern_1): Remove argument regp, unused since
23354         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23355         (compile_pattern): Don't pass it.
23357 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
23359         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23360         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23361         for ! HAVE_GTK3.
23362         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23364         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23366         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
23367         gdk_window_get_screen, gdk_window_get_geometry,
23368         gdk_x11_window_lookup_for_display and GDK_KEY_g.
23369         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23370         (xg_get_pixbuf_from_pixmap): New function.
23371         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23372         to Pixmap, take frame as parameter, remove GdkColormap parameter.
23373         Call xg_get_pixbuf_from_pixmap instead of
23374         gdk_pixbuf_get_from_drawable.
23375         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23376         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23377         (xg_check_special_colors): Use GtkStyleContext and its functions
23378         for HAVE_GTK3.
23379         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23380         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23381         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
23382         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23383         Call gtk_widget_get_preferred_size.
23384         (xg_frame_resized): gdk_window_get_geometry only takes 5
23385         parameters.
23386         (xg_win_to_widget, xg_event_is_for_menubar):
23387         Call gdk_x11_window_lookup_for_display.
23388         (xg_set_widget_bg): New function.
23389         (delete_cb): New function.
23390         (xg_create_frame_widgets): Connect delete-event to delete_cb.
23391         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
23392         (xg_set_background_color): Call xg_set_widget_bg.
23393         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23394         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23395         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23396         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23397         if ! HAVE_GTK3.
23398         (update_frame_tool_bar): Call gtk_widget_hide.
23399         (xg_initialize): Use GDK_KEY_g.
23401         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23402         if ! HAVE_GTK3
23403         (x_session_initialize): Call gdk_x11_set_sm_client_id.
23405         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23406         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23407         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23409 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
23411         * w32xfns.c (select_palette): Check success of RealizePalette against
23412         GDI_ERROR, not zero.
23414 See ChangeLog.11 for earlier changes.
23416 ;; Local Variables:
23417 ;; coding: utf-8
23418 ;; End:
23420   Copyright (C) 2011-2013 Free Software Foundation, Inc.
23422   This file is part of GNU Emacs.
23424   GNU Emacs is free software: you can redistribute it and/or modify
23425   it under the terms of the GNU General Public License as published by
23426   the Free Software Foundation, either version 3 of the License, or
23427   (at your option) any later version.
23429   GNU Emacs is distributed in the hope that it will be useful,
23430   but WITHOUT ANY WARRANTY; without even the implied warranty of
23431   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23432   GNU General Public License for more details.
23434   You should have received a copy of the GNU General Public License
23435   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.