Fix w32 bug with call-process-region.
[emacs.git] / src / ChangeLog
bloba70058ac690865390bac008b7b11cf32437ad818
1 2013-07-16  Paul Eggert  <eggert@cs.ucla.edu>
3         Fix w32 bug with call-process-region (Bug#14885).
4         * callproc.c (Fcall_process_region): Pass nil, not "/dev/null",
5         to Fcall_process when the input is empty.  This simplifies the
6         code a bit.  It makes no difference on POSIXish platforms but
7         apparently it fixes a bug on w32.
9         Fix bug where insert-file-contents closes a file twice. (Bug#14839).
10         * fileio.c (close_file_unwind): Don't close if FD is negative;
11         this can happen when unwinding a zapped file descriptor.
12         (Finsert_file_contents): Unwind-protect the fd before the point marker,
13         in case Emacs runs out of memory between the two unwind-protects.
14         Don't trash errno when closing FD.
15         Zap the FD in the specpdl when closing it, instead of deferring
16         the removal of the unwind-protect; this fixes a bug where a child
17         function unwinds the stack past us.
19         New unwind-protect flavors to better type-check C callbacks.
20         This also lessens the need to write wrappers for callbacks,
21         and the need for make_save_pointer.
22         * alloca.c (free_save_value):
23         * atimer.c (run_all_atimers):
24         Now extern.
25         * alloc.c (safe_alloca_unwind):
26         * atimer.c (unwind_stop_other_atimers):
27         * keyboard.c (cancel_hourglass_unwind) [HAVE_WINDOW_SYSTEM]:
28         * menu.c (cleanup_popup_menu) [HAVE_NS]:
29         * minibuf.c (choose_minibuf_frame_1):
30         * process.c (make_serial_process_unwind):
31         * xdisp.h (pop_message_unwind):
32         * xselect.c (queue_selection_requests_unwind):
33         Remove no-longer-needed wrapper.  All uses replaced by the wrappee.
34         * alloca.c (record_xmalloc):
35         Prefer record_unwind_protect_ptr to record_unwind_protect with
36         make_save_pointer.
37         * alloca.c (Fgarbage_collect):
38         Prefer record_unwind_protect_void to passing a dummy.
39         * buffer.c (restore_buffer):
40         * window.c (restore_window_configuration):
41         * xfns.c, w32fns.c (do_unwind_create_frame)
42         New wrapper.  All record-unwind uses of wrappee changed.
43         * buffer.c (set_buffer_if_live):
44         * callproc.c (call_process_cleanup, delete_temp_file):
45         * coding.c (code_conversion_restore):
46         * dired.c (directory_files_internal_w32_unwind) [WINDOWSNT]:
47         * editfns.c (save_excursion_restore)
48         (subst_char_in_region_unwind, subst_char_in_region_unwind_1)
49         (save_restriction_restore):
50         * eval.c (restore_stack_limits, un_autoload):
51         * fns.c (require_unwind):
52         * keyboard.c (recursive_edit_unwind, tracking_off):
53         * lread.c (record_load_unwind, load_warn_old_style_backquotes):
54         * macros.c (pop_kbd_macro, restore_menu_items):
55         * nsfns.m (unwind_create_frame):
56         * print.c (print_unwind):
57         * process.c (start_process_unwind):
58         * search.c (unwind_set_match_data):
59         * window.c (select_window_norecord, select_frame_norecord):
60         * xdisp.c (unwind_with_echo_area_buffer, unwind_format_mode_line)
61         (fast_set_selected_frame):
62         * xfns.c, w32fns.c (unwind_create_tip_frame):
63         Return void, not a dummy Lisp_Object.  All uses changed.
64         * buffer.h (set_buffer_if_live): Move decl here from lisp.h.
65         * callproc.c (call_process_kill):
66         * fileio.c (restore_point_unwind, decide_coding_unwind)
67         (build_annotations_unwind):
68         * insdel.c (Fcombine_after_change_execute_1):
69         * keyboard.c (read_char_help_form_unwind):
70         * menu.c (unuse_menu_items):
71         * minibuf.c (run_exit_minibuf_hook, read_minibuf_unwind):
72         * sound.c (sound_cleanup):
73         * xdisp.c (unwind_redisplay):
74         * xfns.c (clean_up_dialog):
75         * xselect.c (x_selection_request_lisp_error, x_catch_errors_unwind):
76         Accept no args and return void, instead of accepting and returning
77         a dummy Lisp_Object.  All uses changed.
78         * cygw32.c (fchdir_unwind):
79         * fileio.c (close_file_unwind):
80         * keyboard.c (restore_kboard_configuration):
81         * lread.c (readevalllop_1):
82         * process.c (wait_reading_process_output_unwind):
83         Accept int and return void, rather than accepting an Emacs integer
84         and returning a dummy object.  In some cases this fixes an
85         unlikely bug when the corresponding int is outside Emacs integer
86         range.  All uses changed.
87         * dired.c (directory_files_internal_unwind):
88         * fileio.c (do_auto_save_unwind):
89         * gtkutil.c (pop_down_dialog):
90         * insdel.c (reset_var_on_error):
91         * lread.c (load_unwind):
92         * xfns.c (clean_up_file_dialog):
93         * xmenu.c, nsmenu.m (pop_down_menu):
94         * xmenu.c (cleanup_widget_value_tree):
95         * xselect.c (wait_for_property_change_unwind):
96         Accept pointer and return void, rather than accepting an Emacs
97         save value encapsulating the pointer and returning a dummy object.
98         All uses changed.
99         * editfns.c (Fformat): Update the saved pointer directly via
100         set_unwind_protect_ptr rather than indirectly via make_save_pointer.
101         * eval.c (specpdl_func): Remove.  All uses replaced by definiens.
102         (unwind_body): New function.
103         (record_unwind_protect): First arg is now a function returning void,
104         not a dummy Lisp_Object.
105         (record_unwind_protect_ptr, record_unwind_protect_int)
106         (record_unwind_protect_void): New functions.
107         (unbind_to): Support SPECPDL_UNWIND_PTR etc.
108         * fileio.c (struct auto_save_unwind): New type.
109         (do_auto_save_unwind): Use it.
110         (do_auto_save_unwind_1): Remove; subsumed by new do_auto_save_unwind.
111         * insdel.c (struct rvoe_arg): New type.
112         (reset_var_on_error): Use it.
113         * lisp.h (SPECPDL_UNWIND_PTR, SPECPDL_UNWIND_INT, SPECPDL_UNWIND_VOID):
114         New constants.
115         (specbinding_func): Remove; there are now several such functions.
116         (union specbinding): New members unwind_ptr, unwind_int, unwind_void.
117         (set_unwind_protect_ptr): New function.
118         * xselect.c: Remove unnecessary forward decls, to simplify maintenance.
120         Be simpler and more consistent about reporting I/O errors.
121         * fileio.c (Fcopy_file, Finsert_file_contents, Fwrite_region):
122         Say "Read error" and "Write error", rather than "I/O error", or
123         "IO error reading", or "IO error writing", when a read or write
124         error occurs.
125         * process.c (Fmake_network_process, wait_reading_process_output)
126         (send_process, Fprocess_send_eof, wait_reading_process_output):
127         Capitalize diagnostics consistently.  Put "failed foo" at the
128         start of the diagnostic, so that we don't capitalize the
129         function name "foo".  Consistently say "failed" for such
130         diagnostics.
131         * sysdep.c, w32.c (serial_open): Now accepts Lisp string, not C string.
132         All callers changed.  This is so it can use report_file_error.
133         * sysdep.c (serial_open, serial_configure): Capitalize I/O
134         diagnostics consistently as above.
136         * fileio.c (report_file_errno): Fix errno reporting bug.
137         If the file name is neither null nor a pair, package it up as a
138         singleton list.  All callers changed, both to this function and to
139         report_file_error.  This fixes a bug where the memory allocator
140         invoked by list1 set errno so that the immediately following
141         report_file_error reported the wrong errno value.
143         Fix minor problems found by --enable-gcc-warnings.
144         * frame.c (Fhandle_focus_in, Fhandle_focus_out): Return a value.
145         * keyboard.c (kbd_buffer_get_event): Remove unused local.
147 2013-07-16  Jan Djärv  <jan.h.d@swipnet.se>
149         * xterm.c (x_focus_changed): Always generate FOCUS_IN_EVENT.
150         Set event->arg to Qt if switch-event shall be generated.
151         Generate FOCUS_OUT_EVENT for FocusOut if this is the focused frame.
153         * termhooks.h (enum event_kind): Add FOCUS_OUT_EVENT.
155         * nsterm.m (windowDidResignKey): If this is the focused frame, generate
156         FOCUS_OUT_EVENT.
158         * keyboard.c (Qfocus_in, Qfocus_out): New static objects.
159         (make_lispy_focus_in, make_lispy_focus_out): Declare and define.
160         (kbd_buffer_get_event): For FOCUS_IN, make a focus_in event if no
161         switch frame event is made.  Check ! NILP (event->arg) if X11 (moved
162         from xterm.c). Make focus_out event for FOCUS_OUT_EVENT if NS or X11
163         and there is a focused frame.
164         (head_table): Add focus-in and focus-out.
165         (keys_of_keyboard): Add focus-in and focus-out to Vspecial_event_map,
166         bind to handle-focus-in/out.
168         * frame.c (Fhandle_focus_in, Fhandle_focus_out): New functions.
169         (Fhandle_switch_frame): Call Fhandle_focus_in.
170         (syms_of_frame): defsubr handle-focus-in/out.
172 2013-07-16  Paul Eggert  <eggert@cs.ucla.edu>
174         Fix porting bug to older POSIXish platforms (Bug#14862).
175         * sysdep.c (emacs_pipe): New function, that implements
176         pipe2 (fd, O_CLOEXEC) even on hosts that lack O_CLOEXEC.
177         This should port better to CentOS 5 and to Mac OS X 10.6.
178         All calls to pipe2 changed.
180         Prefer list1 (X) to Fcons (X, Qnil) when building lists.
181         This makes the code easier to read and the executable a bit smaller.
182         Do not replace all calls to Fcons that happen to create lists,
183         just calls that are intended to create lists.  For example, when
184         creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil))
185         rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil).
186         Similarly for list2 through list5.
187         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
188         * bytecode.c (exec_byte_code):
189         * callint.c (quotify_arg, Fcall_interactively):
190         * callproc.c (Fcall_process, create_temp_file):
191         * charset.c (load_charset_map_from_file)
192         (Fdefine_charset_internal, init_charset):
193         * coding.c (get_translation_table, detect_coding_system)
194         (Fcheck_coding_systems_region)
195         (Fset_terminal_coding_system_internal)
196         (Fdefine_coding_system_internal, Fdefine_coding_system_alias):
197         * composite.c (update_compositions, Ffind_composition_internal):
198         * dired.c (directory_files_internal, file_name_completion)
199         (Fsystem_users):
200         * dispnew.c (Fopen_termscript, bitch_at_user, init_display):
201         * doc.c (Fsnarf_documentation):
202         * editfns.c (Fmessage_box):
203         * emacs.c (main):
204         * eval.c (do_debug_on_call, signal_error, maybe_call_debugger)
205         (Feval, eval_sub, Ffuncall, apply_lambda):
206         * fileio.c (make_temp_name, Fcopy_file, Faccess_file)
207         (Fset_file_selinux_context, Fset_file_acl, Fset_file_modes)
208         (Fset_file_times, Finsert_file_contents)
209         (Fchoose_write_coding_system, Fwrite_region):
210         * fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns):
211         * font.c (font_registry_charsets, font_parse_fcname)
212         (font_prepare_cache, font_update_drivers, Flist_fonts):
213         * fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset):
214         * frame.c (make_frame, Fmake_terminal_frame)
215         (x_set_frame_parameters, x_report_frame_params)
216         (x_default_parameter, Fx_parse_geometry):
217         * ftfont.c (syms_of_ftfont):
218         * image.c (gif_load):
219         * keyboard.c (command_loop_1):
220         * keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1)
221         (Fcopy_keymap, append_key, Fcurrent_active_maps)
222         (Fminor_mode_key_binding, accessible_keymaps_1)
223         (Faccessible_keymaps, Fwhere_is_internal):
224         * lread.c (read_emacs_mule_char):
225         * menu.c (find_and_return_menu_selection):
226         * minibuf.c (get_minibuffer):
227         * nsfns.m (Fns_perform_service):
228         * nsfont.m (ns_script_to_charset):
229         * nsmenu.m (ns_popup_dialog):
230         * nsselect.m (ns_get_local_selection, ns_string_from_pasteboard)
231         (Fx_own_selection_internal):
232         * nsterm.m (append2):
233         * print.c (Fredirect_debugging_output)
234         (print_prune_string_charset):
235         * process.c (Fdelete_process, Fprocess_contact)
236         (Fformat_network_address, set_socket_option)
237         (read_and_dispose_of_process_output, write_queue_push)
238         (send_process, exec_sentinel):
239         * sound.c (Fplay_sound_internal):
240         * textprop.c (validate_plist, add_properties)
241         (Fput_text_property, Fadd_face_text_property)
242         (copy_text_properties, text_property_list, syms_of_textprop):
243         * unexaix.c (report_error):
244         * unexcoff.c (report_error):
245         * unexsol.c (unexec):
246         * xdisp.c (redisplay_tool_bar, store_mode_line_string)
247         (Fformat_mode_line, syms_of_xdisp):
248         * xfaces.c (set_font_frame_param)
249         (Finternal_lisp_face_attribute_values)
250         (Finternal_merge_in_global_face, syms_of_xfaces):
251         * xfns.c (x_default_scroll_bar_color_parameter)
252         (x_default_font_parameter, x_create_tip_frame):
253         * xfont.c (xfont_supported_scripts):
254         * xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show)
255         (menu_help_callback, xmenu_show):
256         * xml.c (make_dom):
257         * xterm.c (set_wm_state):
258         Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list,
259         and similarly for list2 through list5.
261 2013-07-15  Paul Eggert  <eggert@cs.ucla.edu>
263         * callproc.c (Fcall_process_region): Fix minor race and tune.
264         (create_temp_file): New function, with the temp-file-creation part
265         of the old Fcall_process_region.  Use Fcopy_sequence to create the
266         temp file name, rather than alloca + build_string, for simplicity.
267         Don't bother to block input around the temp file creation;
268         shouldn't be needed.  Simplify use of mktemp.  Use
269         record_unwind_protect immediately after creating the temp file;
270         this closes an unlikely race where the temp file was not removed.
271         Use memcpy rather than an open-coded loop.
272         (Fcall_process_region): Use the new function.  If the input is
273         empty, redirect from /dev/null rather than from a newly created
274         empty temp file; this avoids unnecessary file system traffic.
276 2013-07-14  Paul Eggert  <eggert@cs.ucla.edu>
278         * filelock.c (create_lock_file) [!HAVE_MKOSTEMP && !HAVE_MKSTEMP]:
279         Simplify by making this case like the other two.  This is a bit
280         slower on obsolete hosts, but the extra complexity isn't worth it.
282         * callproc.c (child_setup, relocate_fd) [!DOS_NT]:
283         * process.c (create_process) [!DOS_NT]:
284         Remove now-unnecessary calls to emacs_close.
286 2013-07-13  Eli Zaretskii  <eliz@gnu.org>
288         * w32term.c (x_draw_hollow_cursor): Delete the brush object when
289         returning early.  (Bug#14850)
291         * coding.c (syms_of_coding): Set up inhibit-null-byte-detection
292         and inhibit-iso-escape-detection attributes of 'undecided'.
293         (Bug#14822)
295 2013-07-13  Paul Eggert  <eggert@cs.ucla.edu>
297         * deps.mk (sysdep.o): Remove dependency on ../lib/ignore-value.h.
298         Reported by Herbert J. Skuhra in
299         <http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00455.html>.
301         Don't lose top specpdl entry when memory is exhausted.
302         * eval.c (grow_specpdl): Increment specpdl top by 1 and check for
303         specpdl overflow here, to simplify callers; all callers changed.
304         Always reserve an unused entry at the stack top; this avoids
305         losing the top entry's information when memory is exhausted.
307 2013-07-12  Paul Eggert  <eggert@cs.ucla.edu>
309         Clean up errno reporting and fix some errno-reporting bugs.
310         * callproc.c (Fcall_process):
311         * fileio.c (Fcopy_file, Finsert_file_contents, Fwrite_region):
312         * process.c (create_process, Fmake_network_process):
313         * unexaix.c (report_error):
314         * unexcoff.c (report_error):
315         Be more careful about reporting the errno of failed operations.
316         The code previously reported the wrong errno sometimes.
317         Also, prefer report_file_errno to setting errno + report_file_error.
318         (Fcall_process): Look at openp return value rather than at path,
319         as that's a bit faster and clearer when there's a numeric predicate.
320         * fileio.c (report_file_errno): New function, with most of the
321         old contents of report_file_error.
322         (report_file_error): Use it.
323         (Ffile_exists_p, Ffile_accessible_directory_p):
324         Set errno to 0 when it is junk.
325         * fileio.c (Faccess_file):
326         * image.c (x_create_bitmap_from_file):
327         Use faccessat rather than opening the file, to avoid the hassle of
328         having a file descriptor open.
329         * lisp.h (report_file_errno): New decl.
330         * lread.c (Flocate_file_internal): File descriptor 0 is valid, too.
332         Minor EBADF fixes.
333         * process.c (create_process, wait_reading_process_output) [AIX]:
334         Remove obsolete SIGHUP-related  code, as Emacs no longer disables
335         SIGHUP, so EBADF is no longer acceptable here (it wouldn't work in
336         a multithreaded environment anyway).
337         * sysdep.c (emacs_close): It's not dangerous to invoke emacs_close (-1).
339 2013-07-12  Andreas Schwab  <schwab@linux-m68k.org>
341         * image.c (x_find_image_file): Don't close a remote file handle.
343 2013-07-12  Paul Eggert  <eggert@cs.ucla.edu>
345         Fix races with threads and file descriptors.
346         * callproc.c (Fcall_process_region):
347         * dired.c (open_directory):
348         * emacs.c (main, Fdaemon_initialized):
349         * image.c (x_find_image_file):
350         * inotify.c (Finotify_rm_watch):
351         * lread.c (Flocate_file_internal):
352         * process.c (Fnetwork_interface_list, Fnetwork_interface_info):
353         * term.c (term_mouse_moveto, init_tty):
354         * termcap.c (tgetent):
355         * unexaix.c, unexcoff.c (report_error, report_error_1, adjust_lnnoptrs)
356         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c (unexec):
357         * unexhp9k800.c, unexmacosx.c (unexec):
358         * callproc.c (Fcall_process_region):
359         Use emacs_close, not close.
360         * sysdep.c (POSIX_CLOSE_RESTART, posix_close) [!POSIX_CLOSE_RESTART]:
361         New macro and function, which emulates the POSIX_CLOSE_RESTART macro
362         and posix_close function on current platforms (which all lack them).
363         (emacs_close): Use it.  This should fix the races on GNU/Linux and
364         on AIX and on future platforms that support POSIX_CLOSE_RESTART,
365         and it should avoid closing random victim file descriptors on
366         other platforms.
368 2013-07-11  Paul Eggert  <eggert@cs.ucla.edu>
370         * inotify.c (uninitialized): Remove.  All uses replaced by -1.
371         (Finotify_add_watch): Simplify, since -1 means uninitialized now.
372         Touch up doc a bit.
374         * eval.c (backtrace_function, backtrace_args): Now EXTERNALLY_VISIBLE.
375         This is for .gdbinit xbacktrace.
377         * sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
378         * sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
379         (emacs_set_tty): Now static.
380         * sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
381         * term.c (tty_capable_p, tty_default_color_capabilities)
382         (get_tty_terminal, term_mouse_movement)
383         (handle_one_term_event, init_tty, maybe_fatal):
384         * termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
385         (tgetent, scan_file, name_match, compare_contin):
386         * terminal.c (get_terminal):
387         Use bool for boolean.
388         * sysdep.c (init_system_name): Don't overflow stack on huge hostname.
389         Prefer char to unsigned char if either will do.
390         * term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
391         (tty_write_glyphs): Prefer int to unsigned.
392         (produce_glyphless_glyph): Remove 2nd (unused) int arg.
393         All callers changed.
394         * termcap.c (tprint, main) [TEST]: Remove non-working test.
396 2013-07-10  Paul Eggert  <eggert@cs.ucla.edu>
398         Port to C89.
399         * bytecode.c (BYTE_CODE_THREADED): Do not define if __STRICT_ANSI__.
400         (B__dummy__): New dummy symbol, to pacify C89.
401         * dbusbind.c (XD_DEBUG_MESSAGE): Omit debugging on C89 hosts, since
402         they can't grok varargs macros.
403         * dispnew.c (add_window_display_history)
404         (add_frame_display_history):
405         * print.c (print_object):
406         * xdisp.c (debug_method_add):
407         Use %p printf format only for void pointers.
408         * emacs.c (usage_message): New constant, replacing ...
409         (USAGE1, USAGE2, USAGE3): Remove; they were too long for C89.
410         (main): Adjust to usage reorg.
411         * fns.c (syms_of_fns):
412         * profiler.c (syms_of_profiler):
413         Don't use non-constant struct initializers.
414         * gnutls.h (gnutls_initstage_t):
415         * lisp.h (enum Lisp_Fwd_Type):
416         * lread.c (lisp_file_lexically_bound_p):
417         * xsettings.c (anonymous enum):
418         Remove trailing comma.
419         * xsettings.c (apply_xft_settings): Use %f, not %lf; %lf is a C99ism.
420         * lisp.h (ENUM_BF): Use unsigned if pedantic.
421         (DEFUN_FUNCTION_INIT): New macro, that falls back on a cast if pre-C99.
422         (DEFUN): Use it.
423         * regex.c (const_re_char): New type, to pacify strict C89.
424         All uses of 'const re_char' replaced to use it.
425         * regex.h (_Restrict_): Rename from __restrict, to avoid clash
426         with glibc when strict C89.  This change is imported from gnulib.
427         All uses changed.
428         (_Restrict_arr_): Rename from __restrict_arr, similarly.
429         * sysdep.c (time_from_jiffies) [!HAVE_LONG_LONG_INT]:
430         Omit GNU_LINUX implementation, since it requires long long.
431         * xterm.c (x_draw_underwave):
432         Do not assume the traditional order of struct's members.
433         (x_term_init): Rewrite to avoid the need for non-constant structure
434         initializers.
436         Syntax cleanup, mostly replacing macros with functions.
437 `       This removes the need for the syntax_temp hack.
438         * search.c: Include syntax.h after buffer.h, since syntax.h uses BVAR.
439         * syntax.c (SYNTAX_INLINE): New macro.
440         (SYNTAX_FLAGS_COMSTART_FIRST, SYNTAX_FLAGS_COMSTART_SECOND)
441         (SYNTAX_FLAGS_COMEND_FIRST, SYNTAX_FLAGS_COMEND_SECOND)
442         (SYNTAX_FLAGS_PREFIX, SYNTAX_FLAGS_COMMENT_STYLEB)
443         (SYNTAX_FLAGS_COMMENT_STYLEC, SYNTAX_FLAGS_COMMENT_STYLEC2)
444         (SYNTAX_FLAGS_COMMENT_NESTED, SYNTAX_FLAGS_COMMENT_STYLE)
445         (SYNTAX_COMEND_FIRST): Now functions, not macros.
446         (ST_COMMENT_STYLE, ST_STRING_STYLE, INTERVALS_AT_ONCE):
447         Now constants, not macros.
448         (syntax_temp) [!__GNUC__]: Remove.
449         (SYNTAX_PREFIX): Remove; all uses replaced by syntax_prefix_flag_p.
450         (syntax_prefix_flag_p): Move implementation of SYNTAX_PREFIX here.
451         (SET_RAW_SYNTAX_ENTRY, SET_RAW_SYNTAX_ENTRY_RANGE, SYNTAX_MATCH)
452         (SETUP_SYNTAX_TABLE, SETUP_SYNTAX_TABLE_FOR_OBJECT):
453         Move here from syntax.h; now functions, not macros.  Except for the
454         last function, these are static since only syntax.c uses them.
455         (syntax_multibyte): Rename from SYNTAX_WITH_MULTIBYTE_CHECK.
456         All uses changed.  Now a function, not a macro; use this fact
457         to simplify the code.
458         (scan_lists, scan_sexps_forward): Remove workarounds for ancient
459         compiler bugs; no longer relevant.
460         * syntax.h: Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
461         (SYNTAX_INLINE): New macro.
462         (struct gl_state_s, gl_state): Move earlier, so that it's in scope
463         for the new functions.  Use bool for boolean member.
464         (SYNTAX_ENTRY, SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH)
465         (SYNTAX_TABLE_BYTE_TO_CHAR, UPDATE_SYNTAX_TABLE_FORWARD)
466         (UPDATE_SYNTAX_TABLE_BACKWARD, UPDATE_SYNTAX_TABLE)
467         (SETUP_BUFFER_SYNTAX_TABLE):
468         Now extern inline functions, not macros.
469         (CURRENT_SYNTAX_TABLE, SYNTAX_ENTRY_INT):
470         Remove; all uses replaced by implementation.
471         (syntax_temp) [!__GNUC__]: Remove decl.
472         (SETUP_SYNTAX_TABLE_FOR_OBJECT): New decl.
474 2013-07-10  Jan Djärv  <jan.h.d@swipnet.se>
476         * emacs.c (main): Fix syntax error.
478 2013-07-10  Paul Eggert  <eggert@cs.ucla.edu>
480         Timestamp fixes for undo (Bug#14824).
481         * atimer.c (schedule_atimer):
482         * fileio.c (Ffile_newer_than_file_p):
483         Minor cleanup: use EMACS_TIME_LT so that we can remove EMACS_TIME_GT.
484         * buffer.c (buffer-undo-list): Document (t . 0) and (t . -1).
485         * fileio.c (Fclear_visited_file_modtime): Move to lisp/files.el.
486         (syms_of_fileio): Remove Sclear_visited_file_name.
487         (Fvisited_file_modtime): Return -1, not (-1 ...), when the visited
488         file doesn't exist; this avoids an ambiguity with negative timestamps.
489         (Fset_visited_file_modtime): Accept -1 and 0 as time-list arg.
490         * systime.h (make_emacs_time, invalid_emacs_time):
491         Don't assume struct timespec layout; POSIX doesn't guarantee it.
492         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE): Remove.
493         * undo.c (record_first_change): Push (visited-file-modtime) onto
494         undo list rather than reimplementing it by hand, incorrectly.
496 2013-07-09  Ken Brown  <kbrown@cornell.edu>
498         * sheap.c (STATIC_HEAP_SIZE) [__x86_64__]: Increase to 18MB.
500 2013-07-09  Juanma Barranquero  <lekktu@gmail.com>
502         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/sysdep.$(O)): Update.
504 2013-07-09  Paul Eggert  <eggert@cs.ucla.edu>
506         Handle errno and exit status a bit more carefully.
507         * callproc.c (child_setup) [!DOS_NT]: Don't try to stuff an error
508         number into an exit status.  Instead, use EXIT_CANCELED.
509         (child_setup) [!MSDOS]: Avoid possible deadlock with vfork.
510         * callproc.c (relocate_fd):
511         * emacs.c (close_output_streams, main):
512         * process.c (create_process):
513         * sysdep.c (sys_subshell) [!DOS_NT || !WINDOWSNT]:
514         Use emacs_perror for simplicity.
515         * callproc.c (relocate_fd, main):
516         * sysdep.c (sys_subshell):
517         Exit with EXIT_CANCELED etc., not 1, when exec setup fails.
518         (shut_down_emacs): Use emacs_write, not write.
519         * emacs.c, sysdep.c: Don't include <ignore-value.h>.
520         * fileio.c (Fcopy_file, e_write):
521         * nsterm.m (ns_select):
522         * process.c (send_process):
523         * sound.c (vox_write):
524         Use emacs_write_sig, not emacs_write.
525         * lisp.h (emacs_write_sig, emacs_perror): New decls.
526         * process.h (EXIT_CANCELED), EXIT_CANNOT_INVOKE, EXIT_ENOENT):
527         New constants.
528         * sysdep.c (emacs_backtrace): Use emacs_write, not ignore_value
529         of write.
530         (emacs_full_write): New function.
531         (emacs_write): Rewrite to use it.
532         (emacswrite_sig, emacs_perror): New functions.
533         * xrdb.c (fatal): Don't invoke perror, since errno might be garbage.
535 2013-07-08  Magnus Henoch <magnus.henoch@gmail.com> (tiny change).
537         * image.c (imagemagick_load_image): Do not use MagickExportImagePixels
538         on NS even if it is present.  Pixmap on NS is a void*.
540 2013-07-07  Paul Eggert  <eggert@cs.ucla.edu>
542         Port to Ubuntu 10 (Bug#14803).
543         Problem reported by T.V. Raman.
544         * process.c (close_on_exec, accept4, process_socket):
545         Define these if !HAVE_ACCEPT4, not if !SOCK_CLOEXEC.
547 2013-07-07  Eli Zaretskii  <eliz@gnu.org>
549         * w32.c (sys_dup): Declare prototype.
551         * filelock.c:
552         * emacs.c:
553         * callproc.c [WINDOWSNT]: Include sys/socket.h.
555 2013-07-07  Paul Eggert  <eggert@cs.ucla.edu>
557         Make file descriptors close-on-exec when possible (Bug#14803).
558         This simplifies Emacs a bit, since it no longer needs to worry
559         about closing file descriptors by hand in some cases.
560         It also fixes some unlikely races.  Not all such races, as
561         libraries often open files internally without setting
562         close-on-exec, but it's an improvement.
563         * alloc.c (valid_pointer_p) [!WINDOWSNT]:
564         * callproc.c (Fcall_process) [!MSDOS]:
565         * emacs.c (main) [!DOS_NT]:
566         * nsterm.m (ns_term_init):
567         * process.c (create_process):
568         Use 'pipe2' with O_CLOEXEC instead of 'pipe'.
569         * emacs.c (Fcall_process_region) [HAVE_MKOSTEMP]:
570         * filelock.c (create_lock_file) [HAVE_MKOSTEMP]:
571         Prefer mkostemp with O_CLOEXEC to mkstemp.
572         * callproc.c (relocate_fd) [!WINDOWSNT]:
573         * emacs.c (main): Use F_DUPFD_CLOEXEC, not plain F_DUPFD.
574         No need to use fcntl (..., F_SETFD, FD_CLOEXEC), since we're
575         now using pipe2.
576         * filelock.c (create_lock_file) [! HAVE_MKOSTEMP]:
577         Make the resulting file descriptor close-on-exec.
578         * lisp.h, lread.c, process.c (close_load_descs, close_process_descs):
579         * lread.c (load_descriptor_list, load_descriptor_unwind):
580         Remove; no longer needed.  All uses removed.
581         * process.c (SOCK_CLOEXEC): Define to 0 if not supplied by system.
582         (close_on_exec, accept4, process_socket) [!SOCK_CLOEXEC]:
583         New functions.
584         (socket) [!SOCK_CLOEXEC]: Supply a substitute.
585         (Fmake_network_process, Fnetwork_interface_list):
586         (Fnetwork_interface_info, server_accept_connection):
587         Make newly-created socket close-on-exec.
588         * sysdep.c (emacs_open, emacs_fopen):
589         Make new-created descriptor close-on-exec.
590         * w32.c (fcntl): Support F_DUPFD_CLOEXEC well enough for Emacs.
591         * w32.c, w32.h (pipe2): Rename from 'pipe', with new flags arg.
593 2013-07-07  Jan Djärv  <jan.h.d@swipnet.se>
595         * nsterm.m (sendEvent:): Propagate keyboard events to modal windows
596         for NS_IMPL_GNUSTEP.
598 2013-07-07  Paul Eggert  <eggert@cs.ucla.edu>
600         Fix openp errno handling.
601         * callproc.c (Fcall_process): Preserve openp errno around close.
602         * lread.c (openp): Set errno when returning -1, as some callers
603         expect this.
605 2013-07-06  Jan Djärv  <jan.h.d@swipnet.se>
607         * nsterm.m (sendEvent:): Handle NSAPP_DATA2_RUNFILEDIALOG.
609         * nsterm.h (NSSavePanel): Update comment.
610         (NSAPP_DATA2_RUNFILEDIALOG): Define.
611         (ns_run_file_dialog): Declare.
613         * nsfns.m: Remove panelOK.
614         (ns_fd_data): New.
615         (ns_run_file_dialog): New function.
616         (Fns_read_file_name): Fill in ns_fd_data, post an event and start the
617         event loop, so file dialog is popped up by ns_run_file_dialog, called
618         by sendEvent (Bug#14578).
619         (EmacsSavePanel, EmacsOpenPanel): Remove ok and cancel methods.
621 2013-07-06  Eli Zaretskii  <eliz@gnu.org>
623         * xdisp.c (default_line_pixel_height): New function.
624         (pos_visible_p, move_it_vertically_backward, try_scrolling)
625         (try_cursor_movement, redisplay_window, try_window)
626         (try_window_id): Use it instead of FRAME_LINE_HEIGHT.  (Bug#14771)
628         * window.c (window_scroll_pixel_based): use
629         default_line_pixel_height.
631         * dispextern.h (default_line_pixel_height): Add prototype.
633         * frame.c (x_set_line_spacing): Accept a float value for
634         line-spacing parameter, per the documentation.
636         * data.c (Fmultibyte_string_p): Doc fix.
638 2013-07-05  Paul Eggert  <eggert@cs.ucla.edu>
640         Use emacs_open more consistently when opening files.
641         This handles EINTR more consistently now, and makes it easier
642         to introduce other uniform changes to file descriptor handling.
643         * src/systdio.h: New file.
644         * src/buffer.c (mmap_init):
645         * cygw32.c (chdir_to_default_directory):
646         * dispnew.c (Fopen_termscript):
647         * emacs.c (Fdaemon_initialized):
648         * fileio.c (Fdo_auto_save):
649         * image.c (slurp_file, png_load_body, jpeg_load_body):
650         * keyboard.c (Fopen_dribble_file):
651         * lread.c (Fload):
652         * print.c (Fredirect_debugging_output):
653         * sysdep.c (get_up_time, procfs_ttyname, procfs_get_total_memory):
654         * termcap.c (tgetent):
655         * unexaix.c, unexcoff.c (unexec, adjust_lnnoptrs):
656         * unexcw.c, unexelf.c, unexhp9k800.c, unexmacosx.c (unexec):
657         * w32term.c (w32_initialize) [CYGWIN]:
658         * xfaces.c (Fx_load_color_file):
659         Use emacs_open instead of plain open, and emacs_fopen instead of
660         plain fopen.
661         * dispnew.c, fileio.c, image.c, keyboard.c, lread.c, print.c, sysdep.c:
662         * xfaces.c: Include sysstdio.h rather than stdio.h, for emacs_fopen.
663         * callproc.c (default_output_mode): New constant.
664         (Fcall_process): Use it to call emacs_open instead of plain creat.
665         * dispnew.c (Fopen_termscript): Fix minor race in opening termscript.
666         * sysdep.c (emacs_open): Add commentary and don't call file name "path".
667         (emacs_fopen): New function.
668         * unexaix.c, unexcoff.c, unexelf.c, unexhp9k800.c, unexmacosx.c:
669         Include <lisp.h>, for emacs_open.
670         * unexelf.c (fatal): Remove decl; not needed with <lisp.h> included.
672         Remove duplicate #include directives.
673         * alloc.c [GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES]:
674         * xfaces.c:
675         Don't include stdio.h twice.
676         * buffer.c [USE_MMAP_FOR_BUFFERS]:
677         Don't include sys/types.h or stdio.h twice.
678         * fileio.c [WINDOWSNT | MSDOS]: Don't include fcntl.h twice.
679         * lread.c: Don't include coding.h twice.
680         * nsfont.m: Don't include frame.h twice.
681         * process.c [HAVE_RES_INIT]: Don't include <netinet/in.h> twice.
682         * ralloc.c: Don't include <unistd.h> twice.
683         * xdisp.c: Don't include font.h twice.
684         * xterm.c: Don't include fontset.h twice.
685         * xterm.h [USE_X_TOOLKIT]: Don't include X11/StringDefs.h twice.
687 2013-07-04  Paul Eggert  <eggert@cs.ucla.edu>
689         Scale ImageMagick images more carefully.
690         * image.c (scale_image_size) [HAVE_IMAGEMAGICK]: New function.
691         (compute_image_size): Use it.  Define only if HAVE_IMAGEMAGICK.
692         Be more careful about avoiding undefined behavior after
693         integer overflow and division by zero.
695 2013-07-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
697         * w32fns.c (Qgeometry, Qworkarea, Qmm_size, Qframes): New variables.
698         (syms_of_w32fns): DEFSYM them.
699         (MONITORINFOF_PRIMARY, SM_XVIRTUALSCREEN, SM_YVIRTUALSCREEN)
700         (CCHDEVICENAME): Define macros if not defined.
701         (struct MONITOR_INFO_EX): New struct.
702         (MonitorEnum_Proc, EnumDisplayMonitors_Proc): New prototypes.
703         (enum_display_monitors_fn): New variable.
704         (globals_of_w32fns): Initialize it.
705         (Fx_display_pixel_width, Fx_display_pixel_height)
706         (Fx_display_mm_height, Fx_display_mm_width): Mention behavior on
707         multi-monitor setups in docstrings.
708         (Fx_display_mm_height, Fx_display_mm_width): Approximate whole
709         screen size by primary monitor's millimeter per pixel.
710         (w32_monitor_enum, w32_display_monitor_attributes_list)
711         (w32_display_monitor_attributes_list_fallback)
712         (Fw32_display_monitor_attributes_list): New functions.
713         (syms_of_w32fns): Defsubr Sw32_display_monitor_attributes_list.
715         * w32term.c (SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREEN): Define macros
716         if not defined.
717         (x_display_pixel_height, x_display_pixel_width): Use GetSystemMetrics.
719 2013-07-04  Michael Albinus  <michael.albinus@gmx.de>
721         * fileio.c (Qfile_notify_error): New error symbol.
723         * gfilenotify.c (Fgfile_add_watch, Fgfile_rm_watch):
724         * inotify.c (inotify_callback, symbol_to_inotifymask)
725         (Finotify_add_watch, Finotify_rm_watch): Use it.
726         (inotifyevent_to_event): Exchange order of cookie and file name.
727         (Finotify_add_watch): Adapt docstring.
729         * lisp.h (Qfile_notify_error): Declare.
731 2013-07-04  Paul Eggert  <eggert@cs.ucla.edu>
733         Try again to fix FreeBSD bug re multithreaded memory alloc (Bug#14569).
734         * emacs.c (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
735         Do not clear _malloc_thread_enabled_p, undoing the previous change,
736         which did not work (see <http://bugs.gnu.org/14569#307>).
737         (main): Do not invoke malloc_enable_thread if (! CANNOT_DUMP
738         && (!noninteractive || initialized)).  This attempts to thread
739         the needle between the Scylla of FreeBSD and the Charybdis of Cygwin.
741 2013-07-04  Juanma Barranquero  <lekktu@gmail.com>
743         * image.c (x_to_xcolors) [HAVE_NTGUI]: Remove unused var `hdc'.
744         (x_build_heuristic_mask) [HAVE_NTGUI]: Remove unused var `frame_dc'.
746 2013-07-04  Paul Eggert  <eggert@cs.ucla.edu>
748         Try to fix FreeBSD bug re multithreaded memory allocation (Bug#14569).
749         * emacs.c (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
750         Clear _malloc_thread_enabled_p at startup.  Reported by Ashish SHUKLA in
751         <http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00088.html>.
753 2013-07-02  Paul Eggert  <eggert@cs.ucla.edu>
755         * sysdep.c (sys_siglist) [HAVE_DECL___SYS_SIGLIST]:
756         Define to __sys_siglist.
758 2013-07-02  Eli Zaretskii  <eliz@gnu.org>
760         * xdisp.c (IT_OVERFLOW_NEWLINE_INTO_FRINGE): Don't disallow
761         word-wrap, so that overflow-newline-into-fringe would work in
762         visual-line-mode.  (Bug#2749)
763         (move_it_in_display_line_to): When the last scanned display
764         element fits exactly on the display line, and
765         overflow-newline-into-fringe is non-nil, but wrap_it is valid,
766         don't return MOVE_NEWLINE_OR_CR, but instead back up to the last
767         wrap point and return MOVE_LINE_CONTINUED.  Fixes problems with
768         finding buffer position that corresponds to pixel coordinates,
769         e.g. in buffer_posn_from_coords.
771 2013-07-02  Jan Djärv  <jan.h.d@swipnet.se>
773         * process.c (handle_child_signal): Call catch_child_signal if
774         NS_IMPL_GNUSTEP.
776 2013-07-02  Paul Eggert  <eggert@cs.ucla.edu>
778         Don't convert function pointers to void * and back.
779         It isn't portable C, and it's easy enough to avoid.
780         * alloc.c: Verify SAVE_FUNCPOINTER bits, too.
781         (make_save_value): Add support for SAVE_FUNCPOINTER.
782         * keymap.c (map_keymap_char_table_item, map_keymap_internal):
783         * print.c (print_object):
784         Distinguish function from object pointers.
785         * lisp.h (SAVE_FUNCPOINTER): New constant.
786         (SAVE_SLOT_BITS): Adjust to it.
787         (SAVE_TYPE_FUNCPTR_PTR_OBJ): New constant, replacing
788         SAVE_TYPE_PTR_PTR_OBJ.  Change the only use.
789         (voidfuncptr): New typedef.
790         (struct Lisp_Save_Value): New member data[0].funcpointer.
791         (XSAVE_FUNCPOINTER): New function.
793         Simplify buildobj processing.
794         * Makefile.in (buildobj.h): Make it a sequence of strings each
795         followed by comma, rather than a single string.  Put it into a
796         .tmp file in case there's an error while generating it.
797         (gl-stamp): Use .tmp for temp files.
798         (mostlyclean): Clean .tmp files.
799         * doc.c (buildobj): Move to just the routine that needs it.
800         It's now an array of strings, so processing is simpler.
802 2013-07-01  Paul Eggert  <eggert@cs.ucla.edu>
804         Fix bug re noninteractive multithreaded memory allocation (Bug#14569).
805         * emacs.c (malloc_enable_thread): Hoist extern decl to top level.
806         (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
807         Invoke malloc_enable_thread even when not interactive.
808         Problem reported by Ken Brown in <http://bugs.gnu.org/14569#275>.
809         * process.c (init_process_emacs) [CYGWIN]: Tickle glib even
810         in this case, since the underlying bug has now been fixed.
812 2013-07-01  Juanma Barranquero  <lekktu@gmail.com>
814         * emacs.c (Fkill_emacs): Expand Vauto_save_list_file_name before
815         unlinking it (bug#14691).
817 2013-06-30  Michal Nazarewicz  <mina86@mina86.com>
819         * buffer.c (FKill_buffer): Run `kill-buffer-query-functions'
820         before checking whether buffer is modified.  This lets
821         `kill-buffer-query-functions' cancel killing of the buffer or save
822         its content before `kill-buffer' asks user the "Buffer %s
823         modified; kill anyway?" question.
825 2013-06-30  Jan Djärv  <jan.h.d@swipnet.se>
827         * nsfns.m (handlePanelKeys): Don't process Command+Function keys.
828         Let the super performKeyEquivalent deal with them (Bug#14747).
830 2013-06-30  Paul Eggert  <eggert@cs.ucla.edu>
832         * widget.c (resize_cb): Remove unused local.
834         Do not use GTK 3 if it exists but cannot be compiled.
835         * xmenu.c (x_menu_wait_for_event) [!USE_GTK]:
836         * xterm.c (x_error_handler) [!USE_GTK]:
837         Do not use GTK 3.
839         * intervals.c (get_local_map): Actually clip POSITION (Bug#14753).
841 2013-06-30  Eli Zaretskii  <eliz@gnu.org>
843         * intervals.c (get_local_map): Instead of aborting, clip POSITION
844         to the valid range of values.  (Bug#14753)
846         * xdisp.c (Fmove_point_visually): Invalidate the cursor position
847         when moving point by using the current glyph matrix.  This avoids
848         the need to force redisplay when this function is called in a
849         loop.
851 2013-06-29  Paul Eggert  <eggert@cs.ucla.edu>
853         Fix minor problems found by static checking.
854         * coding.c (encode_inhibit_flag, inhibit_flag): New functions.
855         Redo the latter's body to sidestep GCC parenthesization warnings.
856         (setup_coding_system, detect_coding, detect_coding_system): Use them.
857         * coding.c (detect_coding, detect_coding_system):
858         * coding.h (struct undecided_spec):
859         Use bool for boolean.
860         * image.c (QCmax_width, QCmax_height): Now static.
861         * xdisp.c (Fmove_point_visually): Remove unused local.
863 2013-06-29  Eli Zaretskii  <eliz@gnu.org>
865         * xdisp.c (Fmove_point_visually): New function.
867 2013-06-28  Kenichi Handa  <handa@gnu.org>
869         * coding.h (define_coding_undecided_arg_index): New enum.
870         (coding_attr_index): New members
871         coding_attr_undecided_inhibit_null_byte_detection,
872         coding_attr_undecided_inhibit_iso_escape_detection,
873         coding_attr_undecided_prefer_utf_8.
874         (undecided_spec): New struct.
875         (struct coding_system): New member `undecided' of the member
876         `spec'.
878         * coding.c (setup_coding_system): Handle CODING->spec.undecided.
879         (detect_coding): Likewise.
880         (detect_coding_system): Likewise.
881         (Fdefine_coding_system_internal): New coding system properties
882         :inhibit-null-byte-detection, :inhibit-iso-escape-detection, and
883         :prefer-utf-8.
884         (syms_of_coding): Adjust for coding_arg_undecided_max.
886 2013-06-28  Paul Eggert  <eggert@cs.ucla.edu>
888         * image.c (x_from_xcolors): Remove unused local.
890 2013-06-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
892         Defer image data transfer between X client and server until actual
893         display happens.
895         * dispextern.h (struct image) [HAVE_X_WINDOWS]: New members `ximg'
896         and `mask_img'.
898         * image.c (Destroy_Image): Remove.
899         (x_clear_image_1): New arg `flags' instead of 3 bools `pixmap_p',
900         `mask_p', and `colors_p'.  All uses changed.
901         (x_clear_image_1) [HAVE_X_WINDOWS]: Destroy `ximg' and `mask_img'.
902         (CLEAR_IMAGE_PIXMAP, CLEAR_IMAGE_MASK, CLEAR_IMAGE_COLORS):
903         New macros for `flags' arg to x_clear_image_1.
904         (postprocess_image, xpm_load_image, x_build_heuristic_mask)
905         (png_load_body): Use x_clear_image_1 instead of Free_Pixmap.
906         (ZPixmap, XGetImage) [HAVE_NS]: Remove.
907         (image_get_x_image_or_dc, image_unget_x_image_or_dc)
908         (image_get_x_image, image_unget_x_image): New functions or macros.
909         (image_background, image_background_transparent, x_to_xcolors)
910         (x_build_heuristic_mask): Use image_get_x_image_or_dc instead of
911         XGetImage or CreateCompatibleDC.  Use image_unget_x_image_or_dc
912         instead of Destroy_Image.
913         (image_create_x_image_and_pixmap, image_put_x_image): New functions.
914         (xpm_load_image, x_from_xcolors, x_build_heuristic_mask, pbm_load)
915         (png_load_body, jpeg_load_body, tiff_load, gif_load)
916         (imagemagick_load_image, svg_load_image): Use them instead of
917         x_create_x_image_and_pixmap, and x_put_x_image followed by
918         x_destroy_x_image, respectively.
919         (xpm_load) [HAVE_XPM && !HAVE_NTGUI]: Use XpmReadFileToImage and
920         XpmCreateImageFromBuffer instead of XpmReadFileToPixmap and
921         XpmCreatePixmapFromBuffer.  Create pixmaps.  Fill background and
922         background_transparent fields.
923         (image_sync_to_pixmaps) [HAVE_X_WINDOWS]: New function.
924         (prepare_image_for_display, x_disable_image) [HAVE_X_WINDOWS]: Use it.
926 2013-06-27  Paul Eggert  <eggert@cs.ucla.edu>
928         Do not tickle glib SIGCHLD handling if Cygwin (Bug#14569).
929         This mostly consists of undoing recent changes.
930         * callproc.c (Fcall_process):
931         * process.c (create_process):
932         Do not worry about catching SIGCHLD here, undoing previous change.
933         * nsterm.m (ns_term_init): Re-catch SIGCHLD, undoing previous change.
934         * process.c, process.h (catch_child_signal):
935         No longer extern if !NS_IMPL_GNUSTEP, undoing 06-22 change.
936         * process.c (catch_child_handler): Don't worry about being called
937         lazily and do not assume caller has blocked SIGCHLD, undoing
938         previous change.  Move first-time stuff back to
939         init_process_emacs, undoing 06-22 change.  If CYGWIN, do not
940         tickle glib, as that causes Cygwin bootstrap to fail.  Do not
941         set lib_child_handler if it's already initialized, which may
942         help avoid problems on GNUStep.
944 2013-06-23  Paul Eggert  <eggert@cs.ucla.edu>
946         A more-conservative workaround for Cygwin SIGCHLD issues (Bug#14569).
947         * callproc.c (Fcall_process):
948         * process.c (create_process):
949         Make sure SIGCHLD is caught before we fork,
950         since Emacs startup no arranges to catch SIGCHLD.
951         * process.c (lib_child_handler): Initialize to null, not to
952         dummy_handler.
953         (catch_child_signal): Allow self to be called lazily.
954         Do nothing if it's already been called.
955         Assume caller has blocked SIGCHLD (all callers do now).
956         * emacs.c (main): Do not catch SIGCHLD here; defer it until
957         just before it's really needed.
958         * nsterm.m (ns_term_init): No need to re-catch SIGCHLD here,
959         since it hasn't been caught yet.
961 2013-06-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
963         * image.c (compute_image_size): New function to implement
964         :max-width and :max-height.
965         (imagemagick_load_image): Use it.
967 2013-06-23  Paul Eggert  <eggert@cs.ucla.edu>
969         Try to avoid malloc SEGVs on Cygwin (Bug#14569).
970         * callproc.c, process.h (block_child_signal, unblock_child_signal):
971         Now extern.
972         * emacs.c (main): Catch SIGCHLD just before initializing gfilenotify.
973         * process.c (catch_child_signal): Block SIGCHLD while futzing with
974         the SIGCHLD handler, since the code is not atomic and (due to glib)
975         signals may be arriving now.
976         * sysdep.c (init_signals): Do not catch child signals here;
977         'main' now does that later, at a safer time.
979 2013-06-22  Paul Eggert  <eggert@cs.ucla.edu>
981         Clean up SIGCHLD handling a bit (Bug#14569).
982         * process.c, process.h (catch_child_signal):
983         Now always extern, even if !NS_IMPL_GNUSTEP.
984         * process.c (catch_child_signal): Move glib tickler here from
985         init_process_emacs, so that it's done earlier in Emacs
986         initialization.  Also move the noninteractive && !initialized
987         check here from init_process_emacs.  This is all a bit cleaner for
988         GNUish platforms, and I hope it works around the Cygwin bug.
989         * sysdep.c (init_signals): Invoke catch_child_signal here, so
990         that glib signal handling is tickled before glib creates threads.
992         * process.c (wait_reading_process_output): Avoid int overflow
993         when reading more than 2 GiB total from a process.
995 2013-06-21  Paul Eggert  <eggert@cs.ucla.edu>
997         * process.c (create_process): Handle a couple more cases,
998         i.e., work even if new_argv and wait_child_setup[i] are cached.
999         Use Fcall_process's style for volatile vars.
1001 2013-06-21  Andreas Schwab  <schwab@linux-m68k.org>
1003         * process.c (create_process): Mark PROCESS volatile.
1005 2013-06-21  Paul Eggert  <eggert@cs.ucla.edu>
1007         Use C99-style flexible array members if available.
1008         This avoids some subtle aliasing issues, which typically
1009         aren't a problem with GCC but may be a problem elsewhere.
1010         * alloc.c (sdata): New typedef, replacing the old struct sdata.
1011         It is a struct if GC_CHECK_STRING_BYTES, a union otherwise.
1012         In either case, it uses a flexible array member rather than
1013         the old struct hack.  All uses changed.
1014         (SDATA_NBYTES, sweep_strings) [!GC_CHECK_STRING_BYTES]:
1015         Adjust to sdata reorganization.
1016         * alloc.c (VBLOCK_BYTES_MIN, allocate_vectorlike, Fgarbage_collect):
1017         Use offsetof (struct, flex_array_member), not sizeof (struct), as
1018         that ports better to pre-C99 non-GCC.
1019         * chartab.c (Fmake_char_table, make_sub_char_table, copy_char_table):
1020         Use CHAR_TABLE_STANDARD_SLOTS rather than its definition,
1021         as the latter has changed.
1022         * conf_post.h (FLEXIBLE_ARRAY_MEMBER): Move here from w32.c,
1023         and port better to pre-C99 GCC.
1024         * image.c (struct xpm_cached_color):
1025         * lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector)
1026         (struct Lisp_Char_Table, struct Lisp_Sub_Char_Table):
1027         Use FLEXIBLE_ARRAY_MEMBER.
1028         * lisp.h (string_bytes) [GC_CHECK_STRING_BYTES]:
1029         Move decl to top level so it gets checked against implementation.
1030         (CHAR_TABLE_STANDARD_SLOTS): Adjust to struct Lisp_Char_Table change.
1031         * w32.c (FLEXIBLE_ARRAY_MEMBER): Move to conf_post.h.
1033 2013-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1035         * syntax.c: Integer cleanups.
1036         (SYNTAX_FLAGS_COMMENT_STYLEC): Return a boolean, not 0-or-2.
1037         All uses that need 0-or-2 changed to:
1038         (SYNTAX_FLAGS_COMMENT_STYLEC2): New macro, with the same semantics
1039         as the old SYNTAX_FLAGS_COMMENT_STYLEC.
1040         (struct lisp_parse_state, syntax_prefix_flag_p, update_syntax_table)
1041         (char_quoted, prev_char_comend_first, back_comment)
1042         (Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
1043         (in_classes, forw_comment, scan_lists, scan_sexps_forward):
1044         Use bool for boolean.
1045         (update_syntax_table, skip_chars, skip_syntaxes):
1046         Prefer int to unsigned when either will do.
1047         (back_comment): Return boolean success flag, like forw_comment,
1048         instead of positive-or-minus-1 (which might have overflowed int anyway).
1049         Don't stuff ptrdiff_t into int.
1050         (syntax_spec_code, syntax_code_spec): Now const.
1051         (Fmatching_paren, scan_lists, scan_sexps_forward):
1052         Use enum syntaxcode for syntax code.
1053         (Fmatching_paren): Check that arg is a character, not just an integer.
1054         (Fstring_to_syntax): Don't assume 0377 fits in enum syntaxcode.
1055         (Finternal_describe_syntax_value): Omit no-longer-needed
1056         comparison to 0.
1057         (skip_chars): Use char, not unsigned char, when the distinction
1058         doesn't matter.
1059         (forw_comment, scan_lists): Prefer A |= B to A = A || B when B's cheap.
1060         * bytecode.c (exec_byte_code):
1061         * syntax.c (syntax_spec_code, Fchar_syntax)
1062         (Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
1063         (init_syntax_once):
1064         * syntax.h (SYNTAX_WITH_FLAGS):
1065         Omit unnecessary casts.
1067 2013-06-20  Eli Zaretskii  <eliz@gnu.org>
1069         * w32fns.c (w32_wnd_proc): Don't compute the header line and mode
1070         line dimensions here, to avoid race conditions with the main
1071         thread.  (Bug#14062, bug#14630, bug#14669)
1073         * w32term.c (w32_draw_window_cursor): Compute the header line and
1074         mode line dimensions here.
1075         <w32_system_caret_window, w32_system_caret_hdr_height>:
1076         <w32_system_caret_mode_height>: New variables.
1078         * w32term.h: Declare them.
1080 2013-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1082         * alloc.c (die): Move "assertion failed" string here ...
1083         * lisp.h (eassert): ... from here.  Also, suppress evaluation of
1084         COND when SUPPRESS_CHECKING.  This shrinks the executable text
1085         size by 0.8% to 2.2% when configured with --enable-checking,
1086         depending on optimization flags (GCC 4.8.1 x86-64).
1088         * floatfns.c (Flog10): Move to Lisp (marked obsolete there).
1090 2013-06-20  Rüdiger Sonderfeld <ruediger@c-plusplus.de>
1092         * floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the
1093         base is 2; this is more accurate.
1095 2013-06-19  Juanma Barranquero  <lekktu@gmail.com>
1097         * sound.c (string_default): Move to !WINDOWSNT section.
1098         (Fplay_sound_internal) [WINDOWSNT]: Remove i_result to avoid warning.
1100 2013-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1102         * sound.c: Integer cleanups.
1103         Remove unnecessary forward decls.
1104         (struct sound_device): The 'file' member is now a Lisp_Object, not
1105         a char *, so that we needn't invoke alloca on a huge size.
1106         (Fplay_sound_internal): Adjust to this.
1107         (string_default): New function.
1108         (vox_open, vox_init, alsa_open, alsa_configure, alsa_init):
1109         Use it to adjust to the struct sound_device change.
1110         (parse_sound, wav_init, au_init, alsa_init): Use bool for booleans.
1111         (be2hs) [0]: Remove.
1113         * syntax.c (skip_chars): Don't use uninitialized storage
1114         when searching a multibyte buffer for characters that are not in a
1115         unibyte string that contains non-ASCII characters.
1117 2013-06-18  Jan Djärv  <jan.h.d@swipnet.se>
1119         * process.c: Include xgselect.h if HAVE_GLIB.  Include glib.h
1120         if HAVE_GLIB && ! WINDOWSNT (Bug#14654).
1122 2013-06-18  Paul Eggert  <eggert@cs.ucla.edu>
1124         * conf_post.h: Add comments for INLINE, EXTERN_INLINE, etc.
1126 2013-06-18  Kenichi Handa  <handa@gnu.org>
1128         * font.c (Ffont_spec): Signal an error for an invalid font name
1129         (Bug#14648).
1131 2013-06-18  Paul Eggert  <eggert@cs.ucla.edu>
1133         Porting fixes for merged specpdl and backtrace stacks (Bug#14643).
1134         In particular this ports to 32-bit sparc Sun cc.
1135         * eval.c (init_eval_once, grow_specpdl): Allocate a specbinding
1136         array with a dummy element at specpdl[-1], so that its address can
1137         be taken portably.
1138         (unbind_to): Do not copy the binding; not needed, now that we
1139         copy old_value in the one place where the copy is needed.
1140         * fileio.c (Fwrite_region): Use ptrdiff_t, not int, for specpdl count.
1141         * lisp.h (BITS_PER_PTRDIFF_T): Remove; no longer needed.
1142         (union specbinding): Rename from struct specbinding.  Redo layout
1143         to avoid the need for 'ptrdiff_t nargs : BITS_PER_PTRDIFF_T - 1;',
1144         which is not portable.  With Sun C 5.12 32-bit sparc, the
1145         declaration causes nargs to be an unsigned bitfield, a behavior
1146         that the C standard allows; but Emacs wants nargs to be signed.
1147         The overall type is now a union of structures rather than a
1148         structure of union of structures, and the 'kind' member is now a
1149         bitfield, so that the overall type doesn't grow.  All uses changed.
1150         * process.c (Fmake_serial_process): Remove unnecessary initialization.
1152 2013-06-17  Paul Eggert  <eggert@cs.ucla.edu>
1154         * frame.c (x_report_frame_params): Cast parent_desc to uintptr_t.
1155         Needed if HAVE_NTGUI.  Reported by Juanma Barranquero.
1157         * nsfont.m (ns_registry_to_script): Parenthesize while expression.
1159 2013-06-17  Eli Zaretskii  <eliz@gnu.org>
1161         * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
1162         unless we know that the window w's frame is a frame object.
1163         Another attempt at solving bug#14062 and bug#14630.
1165 2013-06-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
1167         * textprop.c (property_set_type): New enum.
1168         (add_properties): Allow appending/prepending text properties.
1169         (add_text_properties_1): Factored out of Fadd_text_properties.
1170         (Fadd_text_properties): Move all the code into
1171         add_text_properties_1.
1172         (Fadd_face_text_property): New function that calls
1173         add_text_properties_1.
1175 2013-06-17  Paul Eggert  <eggert@cs.ucla.edu>
1177         Move functions from lisp.h to individual modules when possible.
1178         From a suggestion by Andreas Schwab in <http://bugs.gnu.org/11935#68>.
1179         * alloc.c (XFLOAT_INIT, set_symbol_name):
1180         * buffer.c (CHECK_OVERLAY):
1181         * chartab.c (CHECK_CHAR_TABLE, set_char_table_ascii)
1182         (set_char_table_parent):
1183         * coding.c (CHECK_NATNUM_CAR, CHECK_NATNUM_CDR):
1184         * data.c (BOOLFWDP, INTFWDP, KBOARD_OBJFWDP, OBJFWDP, XBOOLFWD)
1185         (XKBOARD_OBJFWD, XINTFWD, XOBJFWD, CHECK_SUBR, set_blv_found)
1186         (blv_value, set_blv_value, set_blv_where, set_blv_defcell)
1187         (set_blv_valcell):
1188         * emacs.c (setlocale) [!HAVE_SETLOCALE]:
1189         * eval.c (specpdl_symbol, specpdl_old_value, specpdl_where)
1190         (specpdl_arg, specpdl_func, backtrace_function, backtrace_nargs)
1191         (backtrace_args, backtrace_debug_on_exit):
1192         * floatfns.c (CHECK_FLOAT):
1193         * fns.c (CHECK_HASH_TABLE, CHECK_LIST_END)
1194         (set_hash_key_and_value, set_hash_next, set_hash_next_slot)
1195         (set_hash_hash, set_hash_hash_slot, set_hash_index)
1196         (set_hash_index_slot):
1197         * keymap.c (CHECK_VECTOR_OR_CHAR_TABLE):
1198         * marker.c (CHECK_MARKER):
1199         * textprop.c (CHECK_STRING_OR_BUFFER):
1200         * window.c (CHECK_WINDOW_CONFIGURATION):
1201         Move here from lisp.h, and make these functions static rather than
1202         extern inline.
1203         * buffer.c (Qoverlayp):
1204         * data.c (Qsubrp):
1205         * fns.c (Qhash_table_p):
1206         * window.c (Qwindow_configuration_p):
1207         Now static.
1208         * lisp.h: Remove the abovementioned defns and decls.
1210         Use functions, not macros, for XINT etc. (Bug#11935).
1211         In lisp.h, prefer functions to function-like macros, and
1212         constants to object-like macros, when either will do.  This:
1213          . simplifies use, as there's no more need to worry about
1214            arguments' side effects being evaluated multiple times.
1215          . makes the code easier to debug on some platforms.
1216         However, when using gcc -O0, keep using function-like macros
1217         for a few critical operations, for performance reasons.
1218         This sort of thing isn't needed with gcc -Og, but -Og
1219         is a GCC 4.8 feature and isn't widely-enough available yet.
1220         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]:
1221         Remove enum lsb_bits; no longer needed.
1222         (allocate_misc, free_misc): Don't use XMISCTYPE as an lvalue.
1223         * buffer.c (Qoverlap):
1224         * data.c (Qsubrp):
1225         * fns.c (Qhash_table_p):
1226         Now extern, so lisp.h can use these symbols.
1227         * dispextern.h: Include character.h, for MAX_CHAR etc.
1228         (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
1229         (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
1230         (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
1231         (GLYPH_CODE_P): Move here from lisp.h.
1232         (GLYPH_CHAR, GLYPH_FACE, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
1233         (GLYPH_CHAR_VALID_P, GLYPH_CODE_P): Now functions, not macros.
1234         (GLYPH_MODE_LINE_FACE): Now enums, not macros.
1235         * eval.c (Fautoload): Cast XUNTAG output to intptr_t, since
1236         XUNTAG now returns void *.
1237         * lisp.h (lisp_h_XLI, lisp_h_XIL, lisp_h_CHECK_LIST_CONS)
1238         (lisp_h_CHECK_NUMBER CHECK_SYMBOL, lisp_h_CHECK_TYPE)
1239         (lisp_h_CONSP, lisp_h_EQ, lisp_h_FLOATP, lisp_h_INTEGERP)
1240         (lisp_h_MARKERP, lisp_h_MISCP, lisp_h_NILP)
1241         (lisp_h_SET_SYMBOL_VAL, lisp_h_SYMBOL_CONSTANT_P)
1242         (lisp_h_SYMBOL_VAL, lisp_h_SYMBOLP, lisp_h_VECTORLIKEP)
1243         (lisp_h_XCAR, lisp_h_XCDR, lisp_h_XCONS, lisp_h_XHASH)
1244         (lisp_h_XPNTR, lisp_h_XSYMBOL):
1245         New macros, renamed from their sans-lisp_h_ counterparts.
1246         (XLI, XIL, CHECK_LIST_CONS, CHECK_NUMBER CHECK_SYMBOL)
1247         (CHECK_TYPE, CONSP, EQ, FLOATP, INTEGERP, MARKERP)
1248         (MISCP, NILP, SET_SYMBOL_VAL, SYMBOL_CONSTANT_P, SYMBOL_VAL, SYMBOLP)
1249         (VECTORLIKEP, XCAR, XCDR, XCONS, XHASH, XPNTR, XSYMBOL):
1250         If compiling via GCC without optimization, define these as macros
1251         in addition to inline functions.
1252         To disable this, compile with -DINLINING=0.
1253         (LISP_MACRO_DEFUN, LISP_MACRO_DEFUN_VOID): New macros.
1254         (check_cons_list) [!GC_CHECK_CONS_LIST]: Likewise.
1255         (make_number, XFASTINT, XINT, XTYPE, XUNTAG): Likewise, but
1256         hand-optimize only in the USE_LSB_TAG case, as GNUish hosts do that.
1257         (INTMASK, VALMASK): Now macros, since static values cannot be
1258         accessed from extern inline functions.
1259         (VALMASK): Also a constant, for benefit of old GDB.
1260         (LISP_INT_TAG_P): Remove; no longer needed as the only caller
1261         is INTEGERP, which can fold it in.
1262         (XLI, XIL, XHASH, XTYPE, XINT, XFASTINT, XUINT)
1263         (make_number, XPNTR, XUNTAG, EQ, XCONS, XVECTOR, XSTRING, XSYMBOL)
1264         (XFLOAT, XPROCESS, XWINDOW, XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE)
1265         (XSUB_CHAR_TABLE, XBOOL_VECTOR, make_lisp_ptr, CHECK_TYPE)
1266         (CHECK_STRING_OR_BUFFER, XCAR, XCDR, XSETCAR, XSETCDR, CAR, CDR)
1267         (CAR_SAFE, CDR_SAFE, STRING_MULTIBYTE, SDATA, SSDATA, SREF, SSET)
1268         (SCHARS, STRING_BYTES, SBYTES, STRING_SET_CHARS, STRING_COPYIN, AREF)
1269         (ASIZE, ASET, CHAR_TABLE_REF_ASCII, CHAR_TABLE_REF)
1270         (CHAR_TABLE_SET, CHAR_TABLE_EXTRA_SLOTS, SYMBOL_VAL, SYMBOL_ALIAS)
1271         (SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL, SET_SYMBOL_ALIAS)
1272         (SET_SYMBOL_BLV, SET_SYMBOL_FWD, SYMBOL_NAME, SYMBOL_INTERNED_P)
1273         (SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P, SYMBOL_CONSTANT_P)
1274         (XHASH_TABLE, HASH_TABLE_P, CHECK_HASH_TABLE, HASH_KEY, HASH_VALUE)
1275         (HASH_NEXT, HASH_HASH, HASH_INDEX, HASH_TABLE_SIZE)
1276         (XMISC, XMISCANY, XMARKER, XOVERLAY, XSAVE_VALUE, XFWDTYPE)
1277         (XINTFWD, XBOOLFWD, XOBJFWD, XBUFFER_OBJFWD, XKBOARD_OBJFWD)
1278         (XFLOAT_DATA, XFLOAT_INIT, NILP, NUMBERP, NATNUMP)
1279         (RANGED_INTEGERP, CONSP, FLOATP, MISCP, STRINGP, SYMBOLP)
1280         (INTEGERP, VECTORLIKEP, VECTORP, OVERLAYP)
1281         (MARKERP, SAVE_VALUEP, AUTOLOADP, INTFWDP, BOOLFWDP, OBJFWDP)
1282         (BUFFER_OBJFWDP, KBOARD_OBJFWDP, PSEUDOVECTOR_TYPEP)
1283         (PSEUDOVECTORP, WINDOW_CONFIGURATIONP, PROCESSP, WINDOWP)
1284         (TERMINALP, SUBRP, COMPILEDP, BUFFERP, CHAR_TABLE_P)
1285         (SUB_CHAR_TABLE_P, BOOL_VECTOR_P, FRAMEP, IMAGEP, ARRAYP)
1286         (CHECK_LIST, CHECK_LIST_CONS, CHECK_LIST_END, CHECK_STRING)
1287         (CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE)
1288         (CHECK_VECTOR, CHECK_VECTOR_OR_STRING, CHECK_ARRAY)
1289         (CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER, CHECK_WINDOW)
1290         (CHECK_WINDOW_CONFIGURATION, CHECK_PROCESS, CHECK_SUBR)
1291         (CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, XFLOATINT)
1292         (CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT, CHECK_OVERLAY)
1293         (CHECK_NUMBER_CAR, CHECK_NUMBER_CDR, CHECK_NATNUM_CAR)
1294         (CHECK_NATNUM_CDR, FUNCTIONP, SPECPDL_INDEX, LOADHIST_ATTACH)
1295         Now functions.
1296         (check_cons_list) [!GC_CHECK_CONS_LIST]: New empty function.
1297         (LISP_MAKE_RVALUE, TYPEMASK): Remove; no longer needed.
1298         (VALMASK): Define in one place rather than in two, merging the
1299         USE_LSB_TAG parts; this is simpler.
1300         (aref_addr, gc_aset, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM)
1301         (max, min, struct Lisp_String, UNSIGNED_CMP, ASCII_CHAR_P):
1302         Move up, to avoid use before definition.
1303         Also include "globals.h" earlier, for the same reason.
1304         (make_natnum): New function.
1305         (XUNTAG): Now returns void *, not intptr_t, as this means fewer casts.
1306         (union Lisp_Fwd, BOOLFWDP, BOOL_VECTOR_P, BUFFER_OBJFWDP, BUFFERP)
1307         (CHAR_TABLE_P, CHAR_TABLE_REF_ASCII, CONSP, FLOATP, INTEGERP, INTFWDP)
1308         (KBOARD_OBJFWDP, MARKERP, MISCP, NILP, OBJFWDP, OVERLAYP, PROCESSP)
1309         (PSEUDOVECTORP, SAVE_VALUEP, STRINGP, SUB_CHAR_TABLE_P, SUBRP, SYMBOLP)
1310         (VECTORLIKEP, WINDOWP, Qoverlayp, char_table_ref, char_table_set)
1311         (char_table_translate, Qarrayp, Qbufferp, Qbuffer_or_string_p)
1312         (Qchar_table_p, Qconsp, Qfloatp, Qintegerp, Qlambda, Qlistp, Qmarkerp)
1313         (Qnil, Qnumberp, Qsubrp, Qstringp, Qsymbolp, Qvectorp)
1314         (Qvector_or_char_table_p, Qwholenump, Ffboundp, wrong_type_argument)
1315         (initialized, Qhash_table_p, extract_float, Qprocessp, Qwindowp)
1316         (Qwindow_configuration_p, Qimage): New forward declarations.
1317         (XSETFASTINT): Simplify by rewriting in terms of make_natnum.
1318         (STRING_COPYIN): Remove; unused.
1319         (XCAR_AS_LVALUE, XCDR_AS_LVALUE): Remove these macros, replacing with ...
1320         (xcar_addr, xcdr_addr): New functions.  All uses changed.
1321         (IEEE_FLOATING_POINT): Now a constant, not a macro.
1322         (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
1323         (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
1324         (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
1325         (GLYPH_CODE_P): Move to dispextern.h, to avoid define-before-use.
1326         (TYPE_RANGED_INTEGERP): Simplify.
1327         (Qsubrp, Qhash_table_p, Qoverlayp): New extern decls.
1328         (setlocale, fixup_locale, synchronize_system_messages_locale)
1329         (synchronize_system_time_locale) [!HAVE_SETLOCALE]:
1330         Now empty functions, not macros.
1331         (functionp): Return bool, not int.
1332         * window.c (Qwindow_configuration_p): Now extern,
1333         so window.h can use it.
1334         * window.h (Qwindowp): Move decl back to lisp.h.
1336 2013-06-15  Eli Zaretskii  <eliz@gnu.org>
1338         * xdisp.c (Fline_pixel_height): New function, required for solving
1339         bug #14567.
1341 2013-06-15  Paul Eggert  <eggert@cs.ucla.edu>
1343         * fns.c (Fcopy_sequence): Simplify XTYPE calculation.
1345 2013-06-13  Stefan Monnier  <monnier@iro.umontreal.ca>
1347         * lread.c (syms_of_lread):
1348         * fns.c (Fprovide): Adjust to new format of after-load-alist.
1350 2013-06-13  Kelly Dean  <kellydeanch@yahoo.com>  (tiny change)
1352         * fileio.c (Fdo_auto_save): Trap errors in auto-save-hook.  (Bug#14479)
1354 2013-06-12  Xue Fuqiao  <xfq.free@gmail.com>
1356         * fileio.c (expand_file_name): Doc fix.
1358 2013-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1360         Tickle glib by waiting for Emacs itself, not for process 0 (Bug#14569).
1361         * process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
1362         Wait for self, not for 0.  This can't hurt on GNU or similar
1363         system, and may help with Cygwin.
1365         * keyboard.c: Don't use PROP (...) as an lvalue.
1366         (parse_tool_bar_item) [!USE_GTK && !HAVE_NS]:
1367         Use set_prop (A, B), not PROP (A) = B.
1369 2013-06-10  Eli Zaretskii  <eliz@gnu.org>
1371         * xdisp.c (get_it_property): Use it->window instead of generating
1372         a Lisp object from it->w.
1374 2013-06-09  Eli Zaretskii  <eliz@gnu.org>
1376         * xdisp.c (get_it_property): If it->object is a buffer, pass to
1377         get-char-property the window that is being rendered, instead of
1378         the buffer, to support window-specific overlays.  (Bug#14575)
1379         (compute_display_string_pos): When W is NULL, use the current
1380         buffer as the object to pass to get-char-property.
1381         (Fcurrent_bidi_paragraph_direction): Assign NULL to the window
1382         pointer member of the bidi iterator, since no window is pertinent
1383         to this function.
1385 2013-06-08  Eli Zaretskii  <eliz@gnu.org>
1387         * bidi.c (bidi_fetch_char): Accept additional argument, the window
1388         being displayed, and pass it to compute_display_string_pos.
1389         (bidi_level_of_next_char, bidi_resolve_explicit_1)
1390         (bidi_paragraph_init): All callers changed.
1392         * xdisp.c (init_from_display_pos, init_iterator)
1393         (handle_single_display_spec, next_overlay_string)
1394         (get_overlay_strings_1, reseat_1, reseat_to_string)
1395         (push_prefix_prop, Fcurrent_bidi_paragraph_direction):
1396         Set bidi_it.w member from it->w.
1397         (compute_display_string_pos): Accept additional argument, the
1398         window being displayed, and pass it to Fget_char_property.
1399         (Bug#14575)
1401         * dispextern.h (struct bidi_it): New member w, the window being
1402         displayed.
1403         (compute_display_string_pos): Adjust prototype.
1405 2013-06-08  Jan Djärv  <jan.h.d@swipnet.se>
1407         * xgselect.c: Remove unneeded include xterm.h.
1409         * process.c (wait_reading_process_output): Check for NS before GLIB.
1410         GLIB may be linked in due to rsvg, but ns_select must be called.
1412         * xgselect.c (xg_select): Remove call to window_system_available
1413         and g_main_context_pending at the top, so Gdk events (i.e. file
1414         notify) are processed when Emacs is started with -nw.
1416 2013-06-07  Eli Zaretskii  <eliz@gnu.org>
1418         * Makefile.in (ctagsfiles1, ctagsfiles2): Don't include *.m files.
1419         (ctagsfiles3): New variable, includes only *.m files.
1420         (TAGS): Use an explicit language name in the regular expressions,
1421         to avoid transformation of '/SOMETHING' by MSYS to
1422         'c:\MSYS\SOMETHING'.
1424 2013-06-07  Richard Copley  <rcopley@gmail.com>  (tiny change)
1426         * epaths.in: Fix commentary to PATH_SITELOADSEARCH.
1428 2013-06-06  Eli Zaretskii  <eliz@gnu.org>
1430         * xdisp.c (note_mouse_highlight): When mouse-highlight is off,
1431         still need to set the mouse pointer shape and activate help-echo.
1432         (Bug#14558)
1434 2013-06-06  Paul Eggert  <eggert@cs.ucla.edu>
1436         A few porting etc. fixes for the new file monitor code.
1437         See the thread containing
1438         <http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00109.html>.
1439         * gfilenotify.c (dir_monitor_callback, Fgfile_add_watch)
1440         (Fgfile_rm_watch): Don't assume EMACS_INT is the same width as a pointer.
1441         (dir_monitor_callback, Fgfile_rm_watch):
1442         Use assq_no_quit instead of Fassoc, for speed.
1443         (dir_monitor_callback, Fgfile_rm_watch):
1444         eassert that the monitor is a fixnum.
1445         (dir_monitor_callback): No need for CDR_SAFE.
1446         Simplify building of lisp with alternative tails.
1447         (Fgfile_add_watch, Fgfile_rm_watch):
1448         Do not assume glib functions set errno reliably on failure.
1449         (Fgfile_add_watch): Check that the monitor survives the XIL trick,
1450         and signal an error otherwise.
1451         (Fgfile_rm_watch): Prefer CONSP to !NILP.
1452         Use Fdelq instead of Fdelete, for speed.
1454 2013-06-05  Eli Zaretskii  <eliz@gnu.org>
1456         * xdisp.c (handle_tool_bar_click): When mouse-highlight is off,
1457         don't insist on being invoked on a highlighted tool-bar button.
1458         Avoids losing tool-bar functionality when mouse-highlight is nil.
1459         (note_tool_bar_highlight, note_mode_line_or_margin_highlight):
1460         Don't highlight when mouse-highlight is nil.
1461         (note_mouse_highlight): When mouse-highlight is nil, don't return
1462         right away; instead, run tool-bar and mode-line highlight
1463         subroutine, clear any existing highlight, and revert the mouse
1464         pointer to its default shape.  (Bug#14558)
1466 2013-06-05  Stefan Monnier  <monnier@iro.umontreal.ca>
1468         * lisp.mk (lisp): Add prog-mode.el.
1470 2013-06-05  Paul Eggert  <eggert@cs.ucla.edu>
1472         Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
1473         * process.c (dummy_handler): New function.
1474         (lib_child_handler): New static var.
1475         (handle_child_signal): Invoke it.
1476         (catch_child_signal): If a library has set up a signal handler,
1477         save it into lib_child_handler.
1478         (init_process_emacs): If using glib and not on Windows, tickle glib's
1479         child-handling code so that it initializes its private SIGCHLD handler.
1480         * syssignal.h (SA_SIGINFO): Default to 0.
1481         * xterm.c (x_term_init): Remove D-bus hack that I installed on May
1482         31; it should no longer be needed now.
1484 2013-06-05  Michael Albinus  <michael.albinus@gmx.de>
1486         * emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.
1488         * gfilenotify.c (globals_of_gfilenotify): New function.
1489         (syms_of_gfilenotify): Move global initialization there.
1491         * lisp.h (globals_of_gfilenotify) [HAVE_GFILENOTIFY]: Add prototype.
1493 2013-06-05  Stefan Monnier  <monnier@iro.umontreal.ca>
1495         * keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
1496         * keyboard.c (menu_bar_items, tool_bar_items):
1497         * doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
1498         not override local keymaps any more.
1500 2013-06-04  Eli Zaretskii  <eliz@gnu.org>
1502         * window.c (Fpos_visible_in_window_p): Doc fix.  (Bug#14540)
1504 2013-06-03  Eli Zaretskii  <eliz@gnu.org>
1506         * w32console.c (initialize_w32_display): Return the dimensions of
1507         the console window via 2 additional arguments, not via the current
1508         frame.  This avoids crashes due to overrunning the bounds of
1509         frame's decode_mode_spec_buffer, which is not resized following
1510         the change of the frame dimensions from the initial 10x10.
1512         * w32term.h (w32_initialize_display_info): Adjust prototype.
1514         * term.c (init_tty): Take dimensions of the frame from the values
1515         returned by initialize_w32_display.
1517         * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
1518         (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
1519         (LIBES): Add $(GFILENOTIFY_LIBS).
1521         * w32inevt.c (handle_file_notifications): Add dummy implementation
1522         for !HAVE_W32NOTIFY.
1524         * w32term.c: Wrap code with HAVE_W32NOTIFY.
1526 2013-06-03  Jan Djärv  <jan.h.d@swipnet.se>
1528         * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
1530         * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
1532         * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
1534 2013-06-03  Paul Eggert  <eggert@cs.ucla.edu>
1536         Fix minor problems found by static checking.
1537         * data.c (pure_write_error):
1538         Use xsignal2, not Fsignal, as Fsignal might return.
1539         * eval.c (set_backtrace_debug_on_exit): Now static.
1540         (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
1541         No longer inline.  EXTERN_INLINE is needed only for functions
1542         defined in .h files.  Reindent function header as per GNU style.
1543         (backtrace_p, backtrace_top, backtrace_next):
1544         Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
1545         compiler or linker.  Add extern decls to pacify gcc -Wall.
1546         * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
1547         Now static.
1548         * frame.c (free_monitors): Define only on platforms that need it.
1549         * nsterm.m (ns_term_init):
1550         * process.c (catch_child_signal):
1551         Don't worry about whether SIGCHLD is defined, as SIGCHLD is
1552         defined on all porting targets these days.
1553         * process.c, process.h (catch_child_signal):
1554         Make it extern only if NS_IMPL_GNUSTEP is defined.
1556 2013-06-03  Eli Zaretskii  <eliz@gnu.org>
1558         * w32.c (gettimeofday): Make the signature identical to prototype
1559         in nt/inc/sys/time.h.
1561 2013-06-03  Stefan Monnier  <monnier@iro.umontreal.ca>
1563         * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
1564         .gdbinit.
1566         * keyboard.c (safe_run_hooks_error): Improve error message.
1568         * data.c (pure_write_error): Add `object' argument.
1569         * puresize.h (CHECK_IMPURE): Use it.
1571 2013-06-03  Michael Albinus  <michael.albinus@gmx.de>
1573         * Makefile.in (NOTIFY_OBJ): New variable.
1574         (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
1576         * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
1577         Call syms_of_gfilenotify.
1579         * gfilenotify.c: New file.
1581         * keyboard.c (Qfile_notify): New variable.  Replaces Qfile_inotify
1582         and Qfile_w32notify.
1583         (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
1584         HAVE_W32NOTIFY and USE_FILE_NOTIFY.
1586         * lisp.h: Declare syms_of_gfilenotify.
1588         * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
1590 2013-06-03  Stefan Monnier  <monnier@iro.umontreal.ca>
1592         Merge the specpdl and backtrace stacks.  Make the structure of the
1593         specpdl entries more obvious via a tagged union of structs.
1594         * lisp.h (BITS_PER_PTRDIFF_T): New constant.
1595         (enum specbind_tag): New enum.
1596         (struct specbinding): Make it a tagged union of structs.
1597         Add a case for backtrace records.
1598         (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
1599         (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
1600         (backtrace_debug_on_exit): New accessors.
1601         (struct backtrace): Remove.
1602         (struct catchtag): Remove backlist field.
1603         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
1604         Move to eval.c.
1605         (Flocal_variable_p): Speed up the common case where the binding is
1606         already loaded.
1607         * eval.c (backtrace_list): Remove.
1608         (set_specpdl_symbol, set_specpdl_old_value): Remove.
1609         (set_backtrace_args, set_backtrace_nargs)
1610         (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
1611         (backtrace_next): New functions.
1612         (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
1613         (unwind_to_catch, internal_lisp_condition_case)
1614         (internal_condition_case, internal_condition_case_1)
1615         (internal_condition_case_2, internal_condition_case_n): Don't bother
1616         with backtrace_list any more.
1617         (Fsignal): Adjust to new backtrace format.
1618         (grow_specpdl): Move up.
1619         (record_in_backtrace): New function.
1620         (eval_sub, Ffuncall): Use it.
1621         (apply_lambda): Adjust to new backtrace format.
1622         (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
1623         data.c.
1624         (specbind): Adjust to new specpdl format.  Simplify.
1625         (record_unwind_protect, unbind_to): Adjust to new specpdl format.
1626         (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
1627         backtrace format.
1628         (mark_backtrace): Remove.
1629         (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
1630         * xdisp.c (redisplay_internal): Use record_in_backtrace.
1631         * alloc.c (Fgarbage_collect): Use record_in_backtrace.
1632         Use mark_specpdl.
1633         * profiler.c (record_backtrace): Use get_backtrace.
1634         (handle_profiler_signal): Use backtrace_top_function.
1635         * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
1636         accessor functions.
1638 2013-06-02  Jan Djärv  <jan.h.d@swipnet.se>
1640         * process.h (catch_child_signal): Declare.
1642         * process.c (catch_child_signal): New function.
1643         (init_process_emacs): Call it.
1645         * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
1646         (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
1647         NS_IMPL_COCOA.
1648         (x_set_cursor_type): Remove declaration.
1649         (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
1650         (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
1651         (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
1652         (ns_get_color): Use F suffix on float.
1653         (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
1654         (ns_get_rgb_color): Remove.
1655         (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
1656         (note_mouse_movement): x and y are CGFloat.
1657         (ns_draw_fringe_bitmap): Remove unused rowY.
1658         Change #if to COCOA && >= 10_6.
1659         (ns_draw_window_cursor): Remove unused overspill.
1660         (ns_draw_underwave): width and x are EamcsCGFloat.
1661         (ns_draw_box): thickness is CGFloat.
1662         (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
1663         (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
1664         if not in main thread.
1665         (ns_get_pending_menu_title, ns_check_menu_open)
1666         (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
1667         (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
1668         (sendFromMainThread:): New method.
1669         (changeFont:): size is CGFloat.
1670         (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
1671         Disable warning about permanent text.
1672         (characterIndexForPoint:): Adjust return type depending on GNUStep
1673         version.
1674         (mouseDown:): delta is CGFloat.
1675         (updateFrameSize): Remove unised variable f.
1676         (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
1677         Cast float to EmacsCGFloat.
1678         (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
1679         also to -1 when restoring.
1680         (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
1681         inside NS_IMPL_COCOA.
1682         (toggleFullScreen:): Put call to toggleFullScreen inside
1683         NS_IMPL_COCOA.  Cast float to EmacsCGFloat.
1684         (setPosition:portion:whole:): por is CGFloat.
1685         (getMouseMotionPart:window:x:y:): Add F suffix to float.
1686         (mouseDown:): Use CGFloat.
1687         (mouseDragged:): Remove unised variable edge.
1688         (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
1690         * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
1691         of CGFloat differs.
1692         (EmacsApp): New variable nextappdefined.  Declare sendFromMainThread
1693         when NS_IMPL_GNUSTEP.
1694         (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
1695         (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
1696         (EmacsToolbar): Add clearAll.  Add tag argument to
1697         addDisplayItemWithImage.
1698         (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
1700         * nsselect.m (ns_get_local_selection): Remove unused variable type.
1702         * nsmenu.m (ns_update_menubar): Make static.
1703         (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
1704         (fillWithWidgetValue:): Add cast to SEL for setAction.
1705         (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
1706         (update_frame_tool_bar): Update code for GNUStep.
1707         (clearAll): New method.
1708         (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
1709         argument.  Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP.
1710         Move identifierToItem setObject and activeIdentifiers addObject before
1711         call to insertItemWithItemIdentifier.
1712         (validateVisibleItems): Fix indentation.
1713         (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
1714         (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
1715         UtilityWindow to aStyle, remove call to setStyleMask.
1717         * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
1719         * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
1720         (ns_charset_covers, ns_get_covering_families, nsfont_open):
1721         Use F suffix on floats.
1722         (ns_char_width): Returns CGFloat.
1723         (ns_ascii_average_width): w is CGFloat instead of float.
1724         (nsfont_draw): cbuf and c are unsigned.  Cast to char* in call to
1725         DPSxshow.
1726         (ns_glyph_metrics): CGFloat instead of float.
1728         * nsfns.m (x_set_foreground_color, x_set_background_color):
1729         Use EmacsCGFloat.
1730         (ns_implicitly_set_icon_type, Fx_create_frame): Make static,
1731         remove unused variables.
1732         (Fns_read_file_name): Keep track if panel is for save.
1733         Use ns_filename_from_panel/ns_directory_from_panel.
1734         (Fns_list_services): delegate only used for COCOA.
1735         (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep.
1736         Just return the input if GNUStep.
1737         (x_screen_planes): Remove.
1738         (Fxw_color_values): Use EmacsCGFloat
1739         (Fns_display_monitor_attributes_list): Only get screen number for
1740         Cocoa.
1741         (getDirectory, getFilename): Remove from EmacsOpenPanel and
1742         EmacsSavePanel.
1743         (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
1744         ns_directory_from_panel.
1746 2013-06-01  Paul Eggert  <eggert@cs.ucla.edu>
1748         * process.c (handle_child_signal): Also use WCONTINUED.
1749         This is so that list-processes doesn't mistakenly list the process
1750         as stopped, when the process has actually been continued and is
1751         now running.
1753 2013-05-31  Paul Eggert  <eggert@cs.ucla.edu>
1755         Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
1756         * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
1757         not already configured.
1759         * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
1761 2013-05-29  Eli Zaretskii  <eliz@gnu.org>
1763         * Makefile.in (mostlyclean): Remove *.res files.
1765 2013-05-29  Stefan Monnier  <monnier@iro.umontreal.ca>
1767         * fileio.c (Finsert_file_contents): Preserve undo info when reverting
1768         a buffer (bug#8447).
1770 2013-05-27  Eli Zaretskii  <eliz@gnu.org>
1772         * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
1773         display vector, and we backtrack, handle the case that the
1774         previous character position is also displayed from a display
1775         vector or covered by a display string or image.  (Bug#14476)
1777 2013-05-25  Jan Djärv  <jan.h.d@swipnet.se>
1779         * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
1780         (struct MonitorInfo, free_monitors): Remove.
1781         (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
1782         (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
1783         (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
1784         Qframes, Qsource.
1786         * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
1787         (struct MonitorInfo, free_monitors): Remove.
1788         (ns_screen_name): Make static.
1789         (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
1790         (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
1791         Qframes, Qsource.
1793         * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
1794         (struct MonitorInfo): New struct.
1795         (free_monitors, make_monitor_attribute_list): Declare.
1797         * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
1798         New Lisp_Object:s.
1799         (free_monitors, make_monitor_attribute_list): New functions.
1800         (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
1801         Qsource.
1803 2013-05-25  Xue Fuqiao  <xfq.free@gmail.com>
1805         * callproc.c (call_process): Refine the doc string.  (Bug#14045)
1807 2013-05-23  Stefan Monnier  <monnier@iro.umontreal.ca>
1809         * keyboard.c: Apply keyboard decoding only to events that come directly
1810         from the tty, not from unread-command-events (bug#14368).
1811         (read_event_from_main_queue): New function, extracted from read_char).
1812         (read_decoded_char): Remove.
1813         (read_decoded_event_from_main_queue): New function to replace it.
1814         (read_char): Use it.
1815         (read_key_sequence): Use read_char rather than read_decoded_char.
1817         * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
1819 2013-05-22  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
1821         * casetab.c (init_casetab_once): Fix last change (bug#14424).
1823 2013-05-22  Kenichi Handa  <handa@gnu.org>
1825         The following changes are to fix the setting of
1826         buffer-file-coding-system on, for instance, C-x RET c unix RET
1827         _FILE_OF_DOS_EOL_TYPE_ RET.
1829         * coding.h (struct coding_system): New member detected_utf8_chars.
1831         * coding.c (detect_coding_utf_8): Count characters and check EOL
1832         format.  Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
1833         BOM is there.
1834         (setup_coding_system): Do not initialize coding->head_ascii.
1835         (check_ascii): Do not set coding->eol_seen but update it.  Do not
1836         call adjust_coding_eol_type here.
1837         (detect_coding): Fix detection of BOM for utf-8 and utf-16.
1838         If the eol-type of CODING is already specified, adjust the eol type
1839         of the found coding-system.
1840         (decode_coding_gap): Cancel previous change.  Utilize the
1841         character numbers counted by detect_coding_utf_8.  Fix detection
1842         of BOM for utf-8.
1844 2013-05-21  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
1846         * search.c (looking_at_1): Only set last_thing_searched if the match
1847         changed the match-data (bug#14281).
1849 2013-05-21  Dmitry Antipov  <dmantipov@yandex.ru>
1851         * xdisp.c (reseat_at_previous_visible_line_start):
1852         Already declared in dispextern.h, so remove it here.
1853         (move_it_vertically_backward): Likewise.
1855 2013-05-20  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
1857         * xfns.c (check_x_display_info): Don't use XINT for terminal object.
1858         (Fx_display_pixel_width, Fx_display_pixel_height)
1859         (Fx_display_mm_width, Fx_display_mm_height):
1860         Mention `display-monitor-attributes-list' in docstrings.
1862         * nsfns.m (ns_get_screen): Remove function.  All uses removed.
1863         (check_ns_display_info): Sync with check_x_display_info in xfns.c.
1864         (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
1865         (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
1866         (Fx_display_backing_store, Fx_display_visual_class)
1867         (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
1868         (Fx_display_grayscale_p, Fx_display_pixel_width)
1869         (Fx_display_pixel_height, Fx_display_planes)
1870         (Fx_display_color_cells): Sync args and docstrings with xfns.c.
1871         (Fx_display_screens): Don't confuse X11 screens with NS screens.
1872         (Fx_display_mm_width, Fx_display_mm_height)
1873         (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
1874         height for all physical monitors as in X11.
1876         * nsterm.m (x_display_pixel_width, x_display_pixel_height):
1877         Return pixel width or height for all physical monitors as in X11.
1879 2013-05-18  Paul Eggert  <eggert@cs.ucla.edu>
1881         Port --enable-gcc-warnings to clang.
1882         * bytecode.c (exec_byte_code):
1883         * regex.c:
1884         Redo diagnostic pragmas to pacify clang, too.
1885         * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
1886         * editfns.c (Fencode_time):
1887         * fileio.c (file_accessible_directory_p):
1888         * font.c (font_unparse_xlfd):
1889         Use '&"string"[index]' instead of '"string" + (index)'.
1890         * undo.c (user_error): Remove; unused.
1892 2013-05-16  Eli Zaretskii  <eliz@gnu.org>
1894         * insdel.c (insert_1_both): Document the arguments, instead of
1895         referring to insert_1, which no longer exists.
1897         * xdisp.c (message_dolog): If the *Messages* buffer is shown in
1898         some window, increment windows_or_buffers_changed, so that
1899         *Messages* display in that window is updated.  (Bug#14408)
1901         * w32.c: Include epaths.h.
1902         (init_environment): Use cmdproxy.exe without leading directories.
1903         Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
1904         case.
1905         (gettimeofday): Adjust signature and return value to Posix
1906         expectations.
1908         * unexw32.c (open_output_file): Delete the existing emacs.exe
1909         before creating it, to break the hard link to the versioned
1910         executable.
1912         * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
1913         (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
1914         (FIRSTFILE_OBJ): New variables.
1915         (W32_RES): Rename to EMACSRES.  All users changed.
1916         (base_obj): Use $(CM_OBJ).
1917         (ALLOBJS): Use $(FIRSTFILE_OBJ).
1918         (emacs$(EXEEXT)): Depend on $(ADDSECTION).
1919         (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
1920         $(W32_RES_LINK) before $(LIBES).
1921         (emacs.res): Depend on $(EMACS_MANIFEST).  Put emacs.rc in nt.
1923 2013-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
1925         * makefile.w32-in (DOC): Use just "DOC".
1927         * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
1929         * process.c: Export default filters and sentinels to Elisp.
1930         (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
1931         New constants.
1932         (pset_filter, pset_sentinel, make_process, Fset_process_filter)
1933         (Fset_process_sentinel, Fformat_network_address):
1934         Default to them instead of nil.
1935         (server_accept_connection): Sentinels can't be nil any more.
1936         (read_and_dispose_of_process_output): New function, extracted from
1937         read_process_output.
1938         (read_process_output): Use it; filters can't be nil.
1939         (Finternal_default_process_filter): New function, extracted from
1940         read_process_output.
1941         (exec_sentinel_unwind): Remove function.
1942         (exec_sentinel): Don't zilch sentinel while running.
1943         (status_notify): Sentinels can't be nil.
1944         (Finternal_default_process_sentinel): New function extracted from
1945         status_notify.
1946         (setup_process_coding_systems): Default filter is not nil any more.
1947         (syms_of_process): Export new Elisp functions and initialize
1948         new constants.
1949         * lisp.h (make_lisp_proc): New function.
1951 2013-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
1953         * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
1955 2013-05-14  Eli Zaretskii  <eliz@gnu.org>
1957         * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
1958         unless we know that the window w is a leaf window.
1959         Another attempt at solving bug#14062.
1961 2013-05-14  Jan Djärv  <jan.h.d@swipnet.se>
1963         * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
1964         fdesc (Bug#14375).
1966 2013-05-12  Paul Eggert  <eggert@cs.ucla.edu>
1968         * image.c (gif_load): Check that subimages fit (Bug#14345).
1970 2013-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
1972         * lread.c (skip_dyn_eof): New function.
1973         (read1): Use it to skip the end of a file in response to #@00.
1975         * doc.c (get_doc_string): Slightly relax the sanity checking.
1977 2013-05-09  Jan Djärv  <jan.h.d@swipnet.se>
1979         * nsfns.m: Include IOGraphicsLib.h if Cocoa.
1980         (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
1981         (MonitorInfo): New struct.
1982         (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
1983         (Fns_display_monitor_attributes_list): New functions.
1984         (display-usable-bounds): Remove.
1985         (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
1986         Qsource.
1988 2013-05-09  Paul Eggert  <eggert@cs.ucla.edu>
1990         * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
1991         (GTK_CHECK_VERSION): New macro, if not already defined.
1992         All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
1993         replaced by GTK_CHECK_VERSION.
1995 2013-05-08  Paul Eggert  <eggert@cs.ucla.edu>
1997         * xterm.h (GTK_PREREQ): New macro.
1998         All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
1999         to use this macro instead, for consistency and clarity.
2001 2013-05-08  Eli Zaretskii  <eliz@gnu.org>
2003         * xdisp.c (row_for_charpos_p): New function, with code of
2004         cursor_row_p, but accepts an additional argument CHARPOS instead
2005         of using a hardcoded PT.
2006         (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
2007         (row_containing_pos): Call row_for_charpos_p instead of partially
2008         doing the same.  Fixes cursor positioning under longlines-mode
2009         when longlines-show-effect includes more than one newline, when
2010         moving the cursor vertically up.
2012 2013-05-08  Juanma Barranquero  <lekktu@gmail.com>
2014         * makefile.w32-in (ACL_H): New macro.
2015         ($(BLD)/fileio.$(O)): Update dependencies.
2017 2013-05-07  Paul Eggert  <eggert@cs.ucla.edu>
2019         Use Gnulib ACL implementation, for benefit of Solaris etc.  (Bug#14295)
2020         * Makefile.in (LIB_ACL): New macro.
2021         (LIBACL_LIBS): Remove.
2022         (LIBES): Use LIB_ACL, not LIBACL_LIBS.
2023         * fileio.c: Include <acl.h>.
2024         Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
2025         (ACL_NOT_WELL_SUPPORTED): Remove.  All uses replaced by
2026         !acl_errno_valid.
2027         (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
2028         it ourselves.
2030         * unexelf.c: Don't assume ElfW (Half) fits in int.
2031         (entry_address, find_section, unexec): Use ptrdiff_t, not int,
2032         when dealing with ElfW (Half) values, since they can exceed 2**31
2033         on 64-bit OpenBSD hosts.  Problem reported privately by Han Boetes.
2034         (entry_address): Omit unused NUM arg.  All uses changed.
2036 2013-05-07  Juri Linkov  <juri@jurta.org>
2038         * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
2039         to the string converted from number with `Fnumber_to_string'.
2040         (Bug#14254)
2042 2013-05-07  Paul Eggert  <eggert@cs.ucla.edu>
2044         * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
2045         This fixes a problem introduced by my previous change.
2047 2013-05-07  Glenn Morris  <rgm@gnu.org>
2049         * lread.c (readchar): Don't read from a dead buffer.  (Bug#14280)
2051 2013-05-07  Jan Djärv  <jan.h.d@swipnet.se>
2053         * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
2055 2013-05-07  Paul Eggert  <eggert@cs.ucla.edu>
2057         Static checking by GCC 4.8.0.
2058         * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
2059         (x_get_monitor_for_frame, x_make_monitor_attribute_list)
2060         (x_get_monitor_attributes_fallback)
2061         (x_get_monitor_attributes_xinerama)
2062         (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
2063         Define only if USE_GTK.
2064         (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
2065         (x_get_monitor_attributes_fallback): Omit unused locals.
2066         (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
2067         Use double, not float, to avoid mixed-mode floating point arithmetic.
2069 2013-05-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2070             Jan Djärv  <jan.h.d@swipnet.se>
2072         * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
2073         (XINERAMA_CFLAGS): New macros.
2074         (ALL_CFLAGS, LIBES): Use them.
2076         * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
2077         include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
2078         (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
2079         (syms_of_xfns): DEFSYM them.
2080         (struct MonitorInfo): New struct.
2081         (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
2082         (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
2083         (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
2084         (x_get_monitor_attributes_xinerama): New functions.
2085         (Fx_display_monitor_attributes_list): New primitive.
2086         (syms_of_xfns): Defsubr it.
2088         * xterm.h (x_display_info): Add Xatom_net_workarea and
2089         Xatom_net_current_desktop.
2091         * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
2092         and dpyinfo->Xatom_net_current_desktop.
2094 2013-05-06  Eli Zaretskii  <eliz@gnu.org>
2096         * xdisp.c (pos_visible_p): Use the special code for finding the
2097         beginning of a display property or overlay for any "replacing"
2098         display property, not just for display strings.  This solves
2099         incorrect reporting of position by posn-at-point.  (Bug#14241)
2101 2013-05-06  Paul Eggert  <eggert@cs.ucla.edu>
2103         * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
2104         Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
2105         Verify that ElfW (Half) fits in int.
2106         (fatal): Use same signature as lisp.h.
2107         (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
2108         configure and build with -DUNEXELF_DEBUG without worrying about
2109         other modules that use DEBUG.
2110         (DEBUG_LOG) [UNEXELF_DEBUG]: New macro.  All debug code that prints
2111         possibly-wide integers now uses it instead of plain fprintf.
2112         (entry_address): New function, which avoids problems with 32-bit
2113         overflow on 64-bit hosts.
2114         (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
2115         (round_up): Don't assume the remainder fits in int.
2116         (find_section): Use bool for boolean.  Simplify debug code.
2117         (unexec): Don't assume file sizes fit in int or size_t.
2118         Omit unnecessary trailing newline in 'fatal' format.
2119         Use strerror rather than outputting decimal error number.
2120         Remove unused code when emacs is not defined;
2121         this file relies on Emacs now.
2122         Don't assume e_phnum and e_shnum are positive.
2124         * regex.c: Fix problems when DEBUG is defined.
2125         (extract_number, extract_number_and_incr): Define regardless of
2126         whether DEBUG is defined; that's simpler and makes the code less
2127         likely to go stale in the normal case when DEBUG is not defined.
2128         Return int rather than taking an int * arg.  All callers changed.
2129         (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
2130         Remove, replacing with ...
2131         (DEBUG_PRINT): New macro.  All callers changed.
2132         (DEBUG_COMPILES_ARGUMENTS): New macro.
2133         (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
2134         (print_compiled_pattern, print_double_string) [DEBUG]:
2135         Use prototype rather than old-style definition.
2136         (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
2137         (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
2138         (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
2139         (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
2140         Don't assume ptrdiff_t, size_t, and long are the same width as int.
2141         (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
2142         This matters only when DEBUG is defined.
2144 2013-05-05  Eli Zaretskii  <eliz@gnu.org>
2146         * xdisp.c (set_iterator_to_next): Set the
2147         ignore_overlay_strings_at_pos_p flag only if we are _really_
2148         iterating over an overlay string, as indicated by the
2149         current.overlay_string_index member.  (Bug#14306)
2151 2013-05-05  Jan Djärv  <jan.h.d@swipnet.se>
2153         * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
2154         to where it is used, to avoid autorelease issues (Bug#14050).
2156 2013-05-05  Paul Eggert  <eggert@cs.ucla.edu>
2158         `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
2159         * fileio.c (syms_of_fileio): Implement this.
2160         * filelock.c (create_lock_file): If symbolic links don't work, so
2161         we use a regular file as a lock file, do not fsync the lock file;
2162         it's not needed.
2164 2013-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
2166         * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
2167         (syms_of_minibuf): Adjust accodingly.
2168         * lread.c (Fread):
2169         * callint.c (Fcall_interactively): Adjust calls accordingly.
2171 2013-05-04  Eli Zaretskii  <eliz@gnu.org>
2173         * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
2174         w->contents is a buffer before computing everything else.
2175         Use parentheses to disambiguate last part of the condition.
2177         * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
2178         assertion violations.  (Bug#14062)
2180 2013-05-01  David Reitter  <david.reitter@gmail.com>
2182         * nsfns.m (ns_tooltip): Initialize.
2184 2013-04-28  Eli Zaretskii  <eliz@gnu.org>
2186         * coding.c (decode_coding_gap): Don't remove the character before
2187         a newline unless it's a CR character.  (Bug#14287)
2189 2013-04-28  Dan Nicolaescu  <dann@gnu.org>
2191         * dispextern.h (struct face): Move enum face_underline_type
2192         earlier so that bitfields can be in the same word.
2194 2013-04-28  Jan Djärv  <jan.h.d@swipnet.se>
2196         * nsfns.m (handlePanelKeys): New function.
2197         (EmacsOpenPanel:performKeyEquivalent:)
2198         (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
2199         arrows/function/control and copy/paste keys (Bug#14296).
2201 2013-04-27  Juri Linkov  <juri@jurta.org>
2203         * callint.c (Fcall_interactively): Call `Qread_number' for
2204         interactive code letter `n' instead of using duplicate code.
2205         (Bug#14254)
2207 2013-04-27  Paul Eggert  <eggert@cs.ucla.edu>
2209         * systime.h (make_timeval): Declare as 'const'.
2211 2013-04-27  Kenichi Handa  <handa@gnu.org>
2213         * font.c (font_open_entity): Always open a font of manageable
2214         size.
2216 2013-04-26  Paul Eggert  <eggert@cs.ucla.edu>
2218         Port better to AIX (Bug#14258).
2219         * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
2220         to pacify AIX xlc.
2222 2013-04-24  Kenichi Handa  <handa@gnu.org>
2224         * coding.c (decode_coding_iso_2022): When an invalid escape
2225         sequence is encountered, reset the invocation and designation
2226         status to the safest one.
2228 2013-04-22  Paul Eggert  <eggert@cs.ucla.edu>
2230         * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
2231         Without this fix, "make distclean" leaves stamp-h1 behind.
2233 2013-04-20  Erik Charlebois  <erikcharlebois@gmail.com>
2235         * w32fns.c (w32_fullscreen_rect): New function to compute the
2236         window rectangle for the given fullscreen mode.
2237         (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
2238         longer tunes the window size.  This keeps the window's edges flush
2239         with the screen and allows the taskbar to hide itself in fullboth.
2241         * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
2242         window decorations and uses the entire screen.
2244         * w32term.h  (w32_fullscreen_rect) Add prototype.
2245         (struct w32_output): Replace normal_width, normal_height,
2246         normal_top, and normal_left members with a single normal_placement
2247         struct.
2248         (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
2249         Remove macros.
2250         (FRAME_NORMAL_PLACEMENT): New macro.
2252 2013-04-16  Juanma Barranquero  <lekktu@gmail.com>
2254         * minibuf.c (Ftest_completion): Silence compiler warning.
2256 2013-04-15  Eli Zaretskii  <eliz@gnu.org>
2258         * w32fns.c (w32_wnd_proc): Add more assertions to investigate
2259         bug#14062.
2261         * frame.h (WINDOW_FRAME): Protect macro and its argument with
2262         parentheses.
2264         * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
2265         (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
2266         (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
2267         parentheses where appropriate.
2269 2013-04-14  Paul Eggert  <eggert@cs.ucla.edu>
2271         * keyboard.c (timer_start_idle): Remove no-longer-used local.
2273 2013-04-14  Eli Zaretskii  <eliz@gnu.org>
2275         * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
2276         <left-fringe-width, right-fringe-width, fringes-outside-margins>:
2277         Mention in the doc string that setting these variables takes
2278         effect only after a call to set-window-buffer.  (Bug#14200)
2280 2013-04-13  Eli Zaretskii  <eliz@gnu.org>
2282         * indent.c (Fvertical_motion): Don't consider display strings on
2283         overlay strings as display strings on the buffer position we
2284         started from.  This prevents vertical cursor motion from jumping
2285         more than one line when there's an overlay string with a display
2286         property at end of line.
2287         Reported by Karl Chen <Karl.Chen@quarl.org> in
2288         http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
2290 2013-04-12  Stefan Monnier  <monnier@iro.umontreal.ca>
2292         * window.c (select_window): `record_buffer' even if window is
2293         already selected (bug#14191).
2295 2013-04-11  Eli Zaretskii  <eliz@gnu.org>
2297         * window.c (Fwindow_end): Test more flags, including the buffer's
2298         last_overlay_modified flag, to determine whether the window's
2299         display is really up-to-date.  Prevents the function from
2300         returning a stale value.  (Bug#14170)
2301         (Fwindow_line_height): Fix the test for up-to-date-ness of the
2302         current matrix.
2304 2013-04-10  Eli Zaretskii  <eliz@gnu.org>
2306         * frame.c (do_switch_frame): Mark the TTY frame we switch to as
2307         garbaged only if it is not already the top frame on its TTY.
2308         This prevents flickering due to constant redrawing of TTY frames when
2309         there are GUI frames open in the same session.  (Bug#13864)
2311 2013-04-10  Stefan Monnier  <monnier@iro.umontreal.ca>
2313         * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
2314         of marking the idle timers directly.
2316 2013-04-09  Stefan Monnier  <monnier@iro.umontreal.ca>
2318         * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
2319         tables (bug#14054).
2321 2013-04-08  Stefan Monnier  <monnier@iro.umontreal.ca>
2323         * window.c (select_window): Don't record_buffer while the invariant is
2324         temporarily broken (bug#14161).
2326         * fns.c (Fdelq): Don't assume !NILP => CONSP.
2328 2013-04-07  Eli Zaretskii  <eliz@gnu.org>
2330         * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
2332 2013-04-07  Romain Francoise  <romain@orebokech.com>
2334         Ignore additional platform-specific ACL errors (Bug#13702).
2335         * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
2336         (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
2338 2013-03-31  Jan Djärv  <jan.h.d@swipnet.se>
2340         * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
2341         f->output_data.ns.
2343 2013-04-07  Paul Eggert  <eggert@cs.ucla.edu>
2345         Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
2346         This bug was introduced by my 2013-02-25 change that simplified
2347         data_start configuration.  Without this change, on GNU/Linux
2348         an Emacs configured with --enable-profiling fails immediately
2349         due to a profiler signal.
2350         * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
2351         with these flags.  On platforms where special flags are needed
2352         when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
2353         (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
2354         (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
2356 2013-04-07  Dmitry Antipov  <dmantipov@yandex.ru>
2358         Get rid of some platform-specific functions examining window
2359         system and its capabilities.  This is a partial rework of the
2360         2013-04-05 change.
2361         * lisp.h (have_menus_p): Remove prototype.  This function is
2362         replaced with platform-independent window_system_available.
2363         (check_window_system): Move to...
2364         * frame.h (decode_window_system_frame, window_system_available):
2365         ...here, add new prototypes.
2366         * frame.c (window_system_available, decode_window_system_frame):
2367         New functions.
2368         (check_window_system): Platform-independent now.
2369         * xterm.h (x_in_use): Remove declaration.
2370         (check_x_frame):
2371         * w32term.h (check_x_frame):
2372         * nsterm.h (check_x_frame): Remove prototypes.  This function
2373         is replaced with platform-independent decode_window_system_frame.
2374         * msdos.c (have_menus_p): Remove.
2375         * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
2376         Remove platform-specific functions.  Use check_window_system,
2377         decode_window_system_frame and check_ns_display_info where
2378         appropriate.  Minor style and comment tweaks.
2379         * w32fns.c (w32_in_use, check_window_system, have_menus_p)
2380         (check_x_frame): Likewise.
2381         * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
2382         Likewise.
2383         * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
2384         * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
2385         * xmenu.c, xselect.c: All related users changed.
2387 2013-04-03  Kenichi Handa  <handa@gnu.org>
2389         The following changes is to optimize the code for reading UTF-8
2390         files.
2392         * coding.c (check_ascii): Rename from detect_ascii.  Return value
2393         changed.  Check EOL format.  Do not call adjust_coding_eol_type
2394         here.
2395         (check_utf_8): New function.
2396         (adjust_coding_eol_type): Do nothing if already adjusted.
2397         (detect_coding): Compare the return value of check_ascii with
2398         coding->src_bytes.  Call adjust_coding_eol_type if necessary.
2399         (decode_coding_gap): Optimize for valid UTF-8.
2401 2013-03-21  Kenichi Handa  <handa@gnu.org>
2403         * coding.c (syms_of_coding): Cancel previous change.
2405         * insdel.c (insert_from_gap): Fix previous change.
2407 2013-04-05  Dmitry Antipov  <dmantipov@yandex.ru>
2409         Consistently use platform-specific function to detect window system.
2410         * lisp.h (check_window_system): New prototype.  This function is
2411         going to replace check_x, check_w32 and check_ns.
2412         (have_menus_p): Mention msdos.c in comment.
2413         * fontset.c (check_window_system_func): Remove.  Adjust all users.
2414         * fontset.h (check_window_system_func): Remove prototype.
2415         * nsterm.h (check_ns):
2416         * xterm.h (check_x):
2417         * w32term.h (check_w32): Likewise.
2418         * menu.c (Fx_popup_menu): Use check_window_system.
2419         * msdos.c (check_window_system): Define for MS-DOS.
2420         * nsfns.m (check_window_system): Define for NS.  Adjust all users.
2421         * w32fns.c (check_window_system): Likewise for MS-Windows.
2422         * xfns.c (check_window_system): Likewise for X.
2423         * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
2424         * xfaces.c, xmenu.c: Use check_window_system where appropriate.
2426 2013-04-02  Paul Eggert  <eggert@cs.ucla.edu>
2428         Prefer < to > in range checks such as 0 <= i && i < N.
2429         This makes it easier to visualize quantities on a number line.
2430         This patch doesn't apply to all such range checks,
2431         only to the range checks affected by the 2013-03-24 change.
2432         This patch reverts most of the 2013-03-24 change.
2433         * alloc.c (xpalloc, Fgarbage_collect):
2434         * ccl.c (ccl_driver, resolve_symbol_ccl_program):
2435         * character.c (string_escape_byte8):
2436         * charset.c (read_hex):
2437         * data.c (cons_to_unsigned):
2438         * dispnew.c (update_frame_1):
2439         * doc.c (Fsubstitute_command_keys):
2440         * doprnt.c (doprnt):
2441         * editfns.c (hi_time, decode_time_components):
2442         * fileio.c (file_offset):
2443         * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
2444         * font.c (font_intern_prop):
2445         * frame.c (x_set_alpha):
2446         * gtkutil.c (get_utf8_string):
2447         * indent.c (check_display_width):
2448         * keymap.c (Fkey_description):
2449         * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
2450         * lread.c (read1):
2451         * minibuf.c (read_minibuf_noninteractive):
2452         * process.c (wait_reading_process_output):
2453         * search.c (Freplace_match):
2454         * window.c (get_phys_cursor_glyph):
2455         * xdisp.c (redisplay_internal):
2456         * xsmfns.c (smc_save_yourself_CB):
2457         Prefer < to > for range checks.
2458         * dispnew.c (sit_for): Don't mishandle NaNs.
2459         This fixes a bug introduced in the 2013-03-24 change.
2460         * editfns.c (decode_time_components): Don't hoist comparison.
2461         This fixes another bug introduced in the 2013-03-24 change.
2463 2013-03-31  Dmitry Antipov  <dmantipov@yandex.ru>
2465         * frame.h (struct frame): Drop scroll_bottom_vpos
2466         member becaue all real users are dead long ago.
2467         (FRAME_SCROLL_BOTTOM_VPOS): Remove.
2468         * xdisp.c (redisplay_internal): Adjust user.
2470 2013-03-30  Darren Ho  <darren.hoo@gmail.com>  (tiny change)
2472         * nsmenu.m (showAtX:Y:for:): setLevel to
2473         NSPopUpMenuWindowLevel (Bug#13998).
2475 2013-03-30  Jan Djärv  <jan.h.d@swipnet.se>
2477         * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
2478         (ns_check_pending_open_menu): Declare.
2480         * nsmenu.m (ns_update_menubar): Correct NSTRACE.
2481         (x_activate_menubar): Update the menu with title that matches
2482         ns_get_pending_menu_title, and call
2483         ns_check_pending_openmenu (Bug#12698).
2484         (menuWillOpen:): New method.
2485         (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
2487         * nsterm.m (menu_will_open_state, menu_mouse_point)
2488         (menu_pending_title): New varaibles.
2489         (ns_get_pending_menu_title, ns_check_menu_open)
2490         (ns_check_pending_open_menu): New functions.
2492 2013-03-29  Dmitry Antipov  <dmantipov@yandex.ru>
2494         * indent.c (current_column_bol_cache): Remove leftover which is not
2495         used in Fmove_to_column any more.
2496         (current_column, scan_for_column): Adjust users.
2497         * keyboard.c (last_point_position_buffer, last_point_position_window):
2498         Remove leftovers which are not used for recording undo any more.
2499         (command_loop_1, syms_of_keyboard): Adjust users.
2500         * xdisp.c (last_max_ascent): Remove leftover which is not used in
2501         redisplay_window any more.
2502         (move_it_to): Adjust user.
2504 2013-03-29  Juanma Barranquero  <lekktu@gmail.com>
2506         * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
2507         Update dependencies.
2509 2013-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
2511         * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
2512         (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
2513         forward references.
2515 2013-03-28  Dmitry Antipov  <dmantipov@yandex.ru>
2517         * window.h (struct window): Replace hchild, vchild and buffer slots
2518         with the only contents slot.  This is possible because each valid
2519         window may have either the child window (in vertical or horizontal
2520         combination) or buffer to display (for the leaf window).  Using that,
2521         a lof of operations to traverse and/or change window hierarchies may
2522         be simplified.  New member horizontal is used to distinguish between
2523         horizontal and vertical combinations of internal windows.
2524         (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
2525         (WINDOW_VERTICAL_COMBINATION_P): New macros.
2526         (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
2527         * window.c (wset_hchild, wset_vchild): Remove.  Adjust all users.
2528         Use contents slot, not buffer, where appropriate.
2529         (wset_combination): New function.
2530         (wset_buffer): Add eassert.
2531         (Fframe_first_window): Simplify the loop reaching first window.
2532         (Fwindow_buffer): Use WINDOW_LEAF_P.
2533         (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
2534         (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
2535         (unshow_buffer): Convert initial debugging check to eassert.
2536         (replace_window, recombine_windows, Fdelete_other_windows_internal)
2537         (make_parent_window, window_resize_check, window_resize_apply)
2538         (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
2539         (Fset_window_configuration, delete_all_child_windows, save_window_save):
2540         Adjust to match struct window changes.
2541         (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
2542         (mark_window_cursors_off, count_windows, get_leaf_windows)
2543         (foreach_window_1): Simplify the loop.
2544         * alloc.c (mark_object): Do not check for the leaf window because
2545         internal windows has no glyph matrices anyway.
2546         * dispnew.c (clear_window_matrices, showing_window_margins_p)
2547         (allocate_matrices_for_window_redisplay, fake_current_matrices)
2548         (allocate_matrices_for_frame_redisplay, free_window_matrices)
2549         (build_frame_matrix_from_window_tree, mirror_make_current)
2550         (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
2551         (update_window_tree, set_window_update_flags): Simplify the loop.
2552         (sync_window_with_frame_matrix_rows): Enforce live window.
2553         Use contents slot, not buffer, where appropriate.
2554         * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
2555         and WINDOW_HORIZONTAL_COMBINATION_P.
2556         (make_frame_visible_1): Simplify the loop.
2557         Use contents slot, not buffer, where appropriate.
2558         * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
2559         (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
2560         (expose_window_tree): Likewise.
2561         Use contents slot, not buffer, where appropriate.
2562         * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
2563         to avoid deleted windows.  Use contents slot instead of buffer.
2564         * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
2565         * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
2566         * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
2567         * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
2569 2013-03-28  Eli Zaretskii  <eliz@gnu.org>
2571         * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
2572         identify the reasons for assertion violations in bug#14062 and
2573         similar ones.
2574         (Fx_show_tip): Fix compilation error under
2575         "--enable-check-lisp-object-type".  (Bug#14073)
2577         * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
2578         Reported by <rzl24ozi@gmail.com>.
2580 2013-03-28  Dmitry Antipov  <dmantipov@yandex.ru>
2582         * xdisp.c (with_echo_area_buffer_unwind_data): Save window
2583         start marker...
2584         (unwind_with_echo_area_buffer): ...to restore it here.
2585         This is needed to ensure that...
2586         (redisplay_window): ...both window markers are valid here,
2587         which is verified by eassert.
2588         * editfns.c (save_excursion_save): Do not assume that
2589         selected_window always displays the buffer.
2590         * buffer.c (Fbuffer_swap_text): Adjust window start markers.
2591         Fix comment.
2593 2013-03-27  Stefan Monnier  <monnier@iro.umontreal.ca>
2595         * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
2596         the upcase table.
2598 2013-03-27  rzl24ozi  <rzl24ozi@gmail.com>  (tiny changes)
2600         * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
2602 2013-03-27  Eli Zaretskii  <eliz@gnu.org>
2604         * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
2605         since MinGW's w32api headers do.  This avoids compiler warnings.
2607         * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
2608         if already defined.
2610 2013-03-26  Eli Zaretskii  <eliz@gnu.org>
2612         * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
2614 2013-03-26  Jan Djärv  <jan.h.d@swipnet.se>
2616         * gtkutil.c (style_changed_cb): Check if frame is live and an
2617         X frame (Bug#14038).
2619 2013-03-26  Eli Zaretskii  <eliz@gnu.org>
2621         * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
2622         Define only for _WIN32_WINNT less than 0x0500.
2623         (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
2624         MinGW64.
2625         Move inclusion of time.h before sys/time.h, so that MinGW64 could
2626         see its own definitions of 'struct timeval' and 'struct timezone'.
2628         Fix incompatibilities between MinGW.org and MinGW64 headers.
2629         * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
2631         * w32.c (REPARSE_DATA_BUFFER): Guard with
2632         MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
2634 2013-03-25  Jan Djärv  <jan.h.d@swipnet.se>
2636         * xterm.c: Include X11/XKBlib.h
2637         (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
2639 2013-03-24  Andreas Schwab  <schwab@linux-m68k.org>
2641         * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
2642         written backwards.
2643         * blockinput.h (input_blocked_p): Likewise.
2644         * bytecode.c (exec_byte_code): Likewise.
2645         * callproc.c (call_process_kill, call_process_cleanup)
2646         (Fcall_process): Likewise.
2647         * ccl.c (ccl_driver, resolve_symbol_ccl_program)
2648         (Fccl_execute_on_string): Likewise.
2649         * character.c (string_escape_byte8): Likewise.
2650         * charset.c (read_hex): Likewise.
2651         * cm.c (calccost): Likewise.
2652         * data.c (cons_to_unsigned): Likewise.
2653         * dired.c (directory_files_internal, file_name_completion):
2654         Likewise.
2655         * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
2656         (sit_for): Likewise.
2657         * doc.c (Fsubstitute_command_keys): Likewise.
2658         * doprnt.c (doprnt): Likewise.
2659         * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
2660         * emacsgtkfixed.c: Likewise.
2661         * fileio.c (file_offset, Fwrite_region): Likewise.
2662         * floatfns.c (Fexpt, fmod_float): Likewise.
2663         * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
2664         Likewise.
2665         * font.c (font_intern_prop): Likewise.
2666         * frame.c (x_set_alpha): Likewise.
2667         * gtkutil.c (get_utf8_string): Likewise.
2668         * indent.c (check_display_width): Likewise.
2669         * intervals.c (create_root_interval, rotate_right, rotate_left)
2670         (split_interval_right, split_interval_left)
2671         (adjust_intervals_for_insertion, delete_node)
2672         (interval_deletion_adjustment, adjust_intervals_for_deletion)
2673         (merge_interval_right, merge_interval_left, copy_intervals)
2674         (set_intervals_multibyte_1): Likewise.
2675         * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
2676         * keymap.c (Fkey_description): Likewise.
2677         * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
2678         * lread.c (openp, read_integer, read1, string_to_number):
2679         Likewise.
2680         * menu.c (ensure_menu_items): Likewise.
2681         * minibuf.c (read_minibuf_noninteractive): Likewise.
2682         * print.c (printchar, strout): Likewise.
2683         * process.c (create_process, Faccept_process_output)
2684         (wait_reading_process_output, read_process_output, send_process)
2685         (wait_reading_process_output): Likewise.
2686         * profiler.c (make_log, handle_profiler_signal): Likewise.
2687         * regex.c (re_exec): Likewise.
2688         * regex.h: Likewise.
2689         * search.c (looking_at_1, Freplace_match): Likewise.
2690         * sysdep.c (get_child_status, procfs_ttyname)
2691         (procfs_get_total_memory): Likewise.
2692         * systime.h (EMACS_TIME_VALID_P): Likewise.
2693         * term.c (dissociate_if_controlling_tty): Likewise.
2694         * window.c (get_phys_cursor_glyph): Likewise.
2695         * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
2696         (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
2697         Likewise.
2698         * xfns.c (Fx_window_property): Likewise.
2699         * xmenu.c (set_frame_menubar): Likewise.
2700         * xselect.c (x_get_window_property, x_handle_dnd_message):
2701         Likewise.
2702         * xsmfns.c (smc_save_yourself_CB): Likewise.
2703         * xterm.c (x_scroll_bar_set_handle): Likewise.
2705 2013-03-24  Dmitry Antipov  <dmantipov@yandex.ru>
2707         * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
2708         to be optional or nil.  Adjust comment and convert it to docstring.
2709         * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
2710         * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
2712 2013-03-24  Paul Eggert  <eggert@cs.ucla.edu>
2714         Static checking by GCC 4.8-20130319.
2715         * image.c (gif_load): Assume pass < 3 to pacify GCC.
2716         * process.c (Fset_process_datagram_address)
2717         (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
2718         * xdisp.c (get_char_face_and_encoding):
2719         (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
2720         (get_glyph_face_and_encoding): Prepare face before possibly using it.
2721         (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
2723 2013-03-24  Ken Brown  <kbrown@cornell.edu>
2725         * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
2726         fix compilation on 64-bit Cygwin, where underscores are not
2727         automatically prepended.
2729         * w32term.c (w32_initialize): Silence compiler warning.
2731 2013-03-23  Eli Zaretskii  <eliz@gnu.org>
2733         * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
2734         FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
2735         variables, to save and restore frame dimensions.
2736         Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
2737         after returning from a 'fullscreen' configuration.
2738         use SendMessage instead of PostMessage to send the SC_RESTORE message,
2739         to avoid races between the main thread and the input thread.
2741         * w32term.h (struct w32_output): New members normal_width,
2742         normal_height, normal_top, normal_left, and prev_fsmode.
2743         (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
2744         (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
2745         members of a frame.
2747         * w32term.c (w32fullscreen_hook): Record last value of the frame's
2748         'fullscreen' parameter.  Always record previous width and height
2749         of the frame, except when switching out of maximized modes, so
2750         that they could be restored correctly, instead of resetting to the
2751         default frame dimensions.  Send SC_RESTORE command to the frame,
2752         unless we are going to send SC_MAXIMIZE, to restore the frame
2753         resize hints in the mouse pointer shown by the window manager.
2754         (Bug#14032)
2756         * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
2758         * lisp.h (get_frame_param): Adjust conditions for prototype
2759         declaration.
2761 2013-03-22  Ken Brown  <kbrown@cornell.edu>
2763         * unexcw.c: Drop unneeded inclusion of w32common.h.
2764         (report_sheap_usage): Declare.
2765         (read_exe_header): Add magic numbers for x86_64.
2766         (fixup_executable): Fix printf format specifier for unsigned long
2767         argument.
2769 2013-03-22  Dmitry Antipov  <dmantipov@yandex.ru>
2771         * frame.h (struct frame): Put menu_bar_window under #ifdef
2772         because this member is not needed when X toolkit is in use.
2773         (fset_menu_bar_window):
2774         * dispnew.c (clear_current_matrices, clear_desired_matrices)
2775         (free_glyphs, update_frame):
2776         * xdisp.c (expose_frame): Likewise.
2777         (display_menu_bar): Likewise.  Remove redundant eassert.
2778         * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
2779         toolkit is in use.
2781 2013-03-21  Paul Eggert  <eggert@cs.ucla.edu>
2783         Use functions and constants to manipulate Lisp_Save_Value objects.
2784         This replaces code that used macros and strings and token-pasting.
2785         The change makes the C source a bit easier to follow,
2786         and shrinks the Emacs executable a bit.
2787         * alloc.c: Verify some properties of Lisp_Save_Value's representation.
2788         (make_save_value): Change 1st arg from string to enum.  All callers
2789         changed.
2790         (INTX): Remove.
2791         (mark_object): Use if, not #if, for GC_MARK_STACK.
2792         * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
2793         (XSAVE_OBJECT): Now functions, not macros.
2794         (STRING_BYTES_BOUND): Now just a macro, not a constant too;
2795         the constant was never used.
2796         (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
2797         (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
2798         (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
2799         (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
2800         New constants.
2801         (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
2802         type3 with a single member save_type.  All uses changed.
2803         (save_type, set_save_pointer, set_save_integer): New functions.
2804         * print.c (PRINTX): Remove.
2806         * alloc.c: Remove redundant static declarations.
2808 2013-03-20  Dmitry Antipov  <dmantipov@yandex.ru>
2810         * window.h (struct window): Convert left_col, top_line, total_lines
2811         and total_cols from Lisp_Objects to integers.  Adjust comments.
2812         (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
2813         Remove.
2814         (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
2815         (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
2816         * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
2817         Adjust users where appropriate.
2819 2013-03-20  Dmitry Antipov  <dmantipov@yandex.ru>
2821         * frame.h (struct frame): Drop resx and resy because the same data is
2822         available from window system-specific output context.  Adjust users.
2823         (default_pixels_per_inch_x, default_pixels_per_inch_y):
2824         New functions to provide defaults when no window system available.
2825         (FRAME_RES_X, FRAME_RES_Y): New macros.
2826         (NUMVAL): Move from xdisp.c.
2827         * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
2828         (Ffont_face_attributes, Fopen_font):
2829         * image.c (gs_load):
2830         * w32font.c (fill_in_logfont):
2831         * xdisp.c (calc_pixel_width_or_height):
2832         * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
2833         * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
2835 2013-03-20  Kenichi Handa  <handa@gnu.org>
2837         * coding.c (syms_of_coding): Initialize disable_ascii_optimization
2838         to 1 (temporary workaround until a bug related to ASCII
2839         optimization is fixed).
2841 2013-03-19  Dmitry Antipov  <dmantipov@yandex.ru>
2843         * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
2844         Signal error if window is not internal.  Adjust docstring.
2845         (delete_all_child_windows): Use combination_limit to save the buffer.
2846         (Fset_window_configuration): Adjust accordingly.
2847         * print.c (syms_of_print): Initialize debugging output not here...
2848         (init_print_once): ...but in a new function here.
2849         * lisp.h (init_print_once): Add prototype.
2850         * emacs.c (main): Add call to init_print_once.  Adjust comments.
2852 2013-03-18  Dmitry Antipov  <dmantipov@yandex.ru>
2854         * window.c (window_resize_check, window_resize_apply)
2855         (window_from_coordinates, recombine_windows, set_window_buffer)
2856         (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
2857         (Fsplit_window_internal, Fdelete_window_internal)
2858         (freeze_window_starts): Use bool for booleans.
2859         * window.h (window_frame_coordinates, resize_frame_windows)
2860         (freeze_window_starts, set_window_buffer): Adjust prototypes.
2862 2013-03-17  Stefan Monnier  <monnier@iro.umontreal.ca>
2864         * dispnew.c (bitch_at_user): Use `user-error'.
2866 2013-03-17  Ken Brown  <kbrown@cornell.edu>
2868         * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c.  Use it
2869         as return type of image_background.  (Bug#13981)
2870         * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
2872 2013-03-16  Jan Djärv  <jan.h.d@swipnet.se>
2874         * nsterm.m (updateFrameSize:): Change resize increments if needed.
2875         (ns_select): Don't return with result uninitialized.
2877         * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
2878         and getDirectory.
2880         * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
2881         New functions.
2882         (Fns_read_file_name): ret is BOOL.  If ! dir_only_p, don't choose
2883         directories.  If filename is nil, get directory name (Bug#13932).
2884         Use getFilename and getDirectory.
2885         (getFilename, getDirectory): New methods for EmacsSavePanel and
2886         EmacsOpenPanel.
2887         (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
2889 2013-03-15  Paul Eggert  <eggert@cs.ucla.edu>
2891         * coding.c (decode_coding_gap): Fix typo caught by static checking.
2893 2013-03-15  Kenichi Handa  <handa@gnu.org>
2895         * insdel.c (insert_from_gap): New arg text_at_gap_tail.
2896         (adjust_after_replace): Make it back to static.  Delete the third
2897         arg text_at_gap_tail.  Cancel the code for handling it.
2899         * coding.h (struct coding_system): New member eol_seen.
2901         * coding.c (detect_ascii): New function.
2902         (detect_coding): Set coding->head_ascii and coding->eol_seen only
2903         when the source bytes are actually scanned.  On detecting for
2904         coding_category_utf_8_auto, call detect_ascii instead of scanning
2905         source bytes directly.
2906         (produce_chars): Call insert_from_gap with the new arg 0.
2907         (encode_coding): Likewise.
2908         (decode_coding_gap): Control ASCII optimization by the variable
2909         disable_ascii_optimization instead of #ifndef .. #endif.
2910         Deccode EOL format according to coding->eol_seen.
2911         (syms_of_coding): Declare disable-ascii-optimization as a Lisp
2912         variable.
2914         * lisp.h (adjust_after_replace): Cancel externing it.
2915         (insert_from_gap): Adjust prototype.
2917 2013-03-15  Eli Zaretskii  <eliz@gnu.org>
2919         * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
2920         FULLSCREEN_MAXIMIZED.  (Bug#13935)
2922 2013-03-15  Dmitry Antipov  <dmantipov@yandex.ru>
2924         * region-cache.c (find_cache_boundary, move_cache_gap)
2925         (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
2926         Simplify debugging check and convert to eassert.  Adjust comment.
2927         (pp_cache): Put under ENABLE_CHECKING.
2929 2013-03-14  Eli Zaretskii  <eliz@gnu.org>
2931         * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
2932         and incorrect code.  Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
2933         and WM_ACTIVATEAPP.
2934         (w32fullscreen_hook): If the frame is visible, reset
2935         f->want_fullscreen flag after changing the frame size.  If the
2936         frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
2937         (Bug#13953)
2939 2013-03-13  Daniel Colascione  <dancol@dancol.org>
2941         * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
2942         too so that these builds can use Cygwin's file conversion
2943         functions.  (We've been building and linking cygw32.o all along
2944         and just not using it.)
2946 2013-03-13  Paul Eggert  <eggert@cs.ucla.edu>
2948         File synchronization fixes (Bug#13944).
2949         * Makefile.in (LIB_FDATASYNC): New macro.
2950         (LIBES): Use it.
2951         * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
2952         * fileio.c (Fwrite_region, write_region_inhibit_fsync):
2953         Don't worry about HAVE_FSYNC, since a substitute fsync is
2954         available if the system lacks one.
2955         (Fwrite_regin): Retry fsync if interrupted.
2957 2013-03-13  Eli Zaretskii  <eliz@gnu.org>
2959         * w32term.c (w32_read_socket): If the Emacs frame is being
2960         activated, call w32fullscreen_hook, to make sure the new frame
2961         dimensions are in effect.  (Bug#13937)
2963 2013-03-13  Dmitry Antipov  <dmantipov@yandex.ru>
2965         * xdisp.c (init_iterator): Simplify because both character and byte
2966         positions are either specified or -1.  Add eassert.  Adjust comment.
2967         * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
2968         character and byte positions can be obtained from marker.
2970 2013-03-13  Paul Eggert  <eggert@cs.ucla.edu>
2972         Static checking by Sun C 5.12.
2973         * alloc.c (buffer_memory_full) [REL_ALLOC]:
2974         * bytecode.c (exec_byte_code):
2975         * dispnew.c (init_display):
2976         * eval.c (error):
2977         * fileio.c (Fsubstitute_in_file_name):
2978         * keyboard.c (Fevent_convert_list):
2979         * keymap.c (Fsingle_key_description):
2980         * term.c (maybe_fatal, fatal):
2981         * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
2982         * xsmfns.c (Fhandle_save_session):
2983         Omit unreachable code.
2984         * keymap.c (map_keymap_char_table_item): Cast void * to
2985         a function pointer type; the C Standard requires this.
2987         * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
2988         Include <sys/param.h> unconditionally, as that works elsewhere and
2989         is simpler here.  Include <sys/sysctl.h> if DARWIN_OS ||
2990         __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
2991         and FreeBSD now.
2993 See ChangeLog.12 for earlier changes.
2995 ;; Local Variables:
2996 ;; coding: utf-8
2997 ;; End:
2999   Copyright (C) 2011-2013 Free Software Foundation, Inc.
3001   This file is part of GNU Emacs.
3003   GNU Emacs is free software: you can redistribute it and/or modify
3004   it under the terms of the GNU General Public License as published by
3005   the Free Software Foundation, either version 3 of the License, or
3006   (at your option) any later version.
3008   GNU Emacs is distributed in the hope that it will be useful,
3009   but WITHOUT ANY WARRANTY; without even the implied warranty of
3010   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3011   GNU General Public License for more details.
3013   You should have received a copy of the GNU General Public License
3014   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.