+2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
+ * dired.c: Assume HAVE_DIRENT_H.
+ (NAMLEN): Remove, replacing with ...
+ (dirent_namelen): New function. All uses changed. Use the GNU macro
+ _D_EXACT_NAMELEN if available, as it's faster than strlen.
+ (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
+ (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
+ * makefile.w32-in (DIR_H): Remove. All uses replaced with
+ $(NT_INC)/dirent.h.
+ ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
+ * ndir.h: Rename to ../nt/inc/dirent.h.
+ * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
+ Do not include <dirent.h>; no longer needed.
+ * w32.c: Include <dirent.h> rather than "ndir.h".
+
+2012-11-23 Chong Yidong <cyd@gnu.org>
+
+ * xftfont.c (xftfont_open): Remove duplicate assignment.
+
+2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * alloc.c (Fgarbage_collect): Unblock input after clearing
+ gc_in_progress to avoid note_mouse_highlight glitch with GC.
+ * frame.h (FRAME_MOUSE_UPDATE): New macro.
+ * msdos.c (IT_frame_up_to_date): Use it here...
+ * w32term.c (w32_frame_up_to_date): ...here...
+ * xterm.c (XTframe_up_to_date): ...and here...
+ * nsterm.m (ns_frame_up_to_date): ...but not here.
+ * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
+ Adjust users.
+ * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
+ Do not check whether GC is in progress.
+
+2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (window_buffer_changed): New function.
+ (update_menu_bar, update_tool_bar): Use it to
+ simplify large 'if' statements.
+ (redisplay_internal): Generalize commonly used
+ 'tail' and 'frame' local variables.
+
+2012-11-22 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
+ with Windows system header.
+
+2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
+ * alloc.c: Assume unistd.h exists.
+ * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
+ * sysdep.c (get_current_dir_name): Assume getcwd exists.
+ (getwd) [USG]: Remove; no longer needed.
+ (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
+ * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
+ * w32.h (getcwd): Remove decl.
+
+2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
+ Make it set selected_window as well.
+ (update_tool_bar): Use it.
+
+2012-11-21 Ken Brown <kbrown@cornell.edu>
+
+ * emacs.c (main): Set the G_SLICE environment variable for all
+ Cygwin builds, not just GTK builds. See
+ https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
+
+2012-11-21 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
+ (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
+ Define for the MSVC compiler.
+
+ * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
+
+ * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
+ (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
+ dostounix_filename. Prevents crashes down the road, because
+ dostounix_filename assumes it gets a unibyte string. Reported by
+ Michel de Ruiter <michel@sentient.nl>, see
+ http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
+
+2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Conflate Qnil and Qunbound for `symbol-function'.
+ * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
+ * lread.c (init_obarray): Set `function' fields to Qnil.
+ * eval.c (Fcommandp): Ignore Qunbound.
+ (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
+ * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
+ Test NILP rather than Qunbound.
+ (Ffmakunbound): Set to Qnil.
+ (Fsymbol_function): Never signal an error.
+ (Finteractive_form): Ignore Qunbound.
+
+2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * eval.c (interactive_p): Remove no-longer-used decl.
+
+2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (buffer_shared): Adjust comment.
+ (buffer_shared_and_changed): New function.
+ (prepare_menu_bars, redisplay_internal): Use it to
+ decide whether all windows or frames should be updated.
+ (window_outdated): New function.
+ (text_outside_line_unchanged_p, redisplay_window): Use it.
+ (redisplay_internal): Likewise. Fix indentation.
+
+2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
+ (syms_of_eval): Remove corresponding defsubr.
+ * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
+
+2012-11-19 Daniel Colascione <dancol@dancol.org>
+
+ * w32fns.c (Fx_file_dialog):
+ (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
+ cygwin_convert_file_name*.
+
+ * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
+ Rename cygwin_convert_path* to cygwin_convert_file_name*.
+
+2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
+
+2012-11-18 Eli Zaretskii <eliz@gnu.org>
+
+ * w32select.c: Include w32common.h before w32term.h, so that
+ windows.h gets included before w32term.h uses some of its
+ features, see below.
+
+ * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
+ New typedefs.
+ (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
+ New prototypes.
+ (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
+
+2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
+ (ns_select): Return at once if events are held (Bug#12834).
+
+2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
+
+ * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
+ Needed following 2012-10-20 change. (Bug#12902)
+
+2012-11-18 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32proc.c (waitpid): Remove unused label get_result.
+
+2012-11-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in (SYSWAIT_H): New macro.
+ ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
+ ($(BLD)/sysdep.$(O)): Update dependencies.
+
+2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
+ * callproc.c (relocate_fd): Assume F_DUPFD.
+ * emacs.c, term.c (O_RDWR): Remove.
+ * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
+ O_NDELAY, since O_NONBLOCK is the standard name for this flag.
+ * nsterm.m: Assume <fcntl.h> exists.
+ * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
+ (create_pty, Fmake_network_process, server_accept_connection)
+ (wait_reading_process_output, init_process_emacs):
+ Assume O_NONBLOCK.
+ (wait_reading_process_output): Put in a special case for WINDOWSNT
+ to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
+ It's not clear this is needed, but it's a more-conservative change.
+ (create_process): Assume FD_CLOEXEC.
+ (create_process, create_pty): Assume O_NOCTTY.
+ * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
+ (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
+ Omit if not DOS_NT, since F_GETFL is not defined there.
+ (serial_open): Assume O_NONBLOCK and O_NOCTTY.
+ * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
+ (O_NOCTTY): Remove.
+ (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
+ lack it, since gnulib guarantees this.
+ * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
+
+2012-11-17 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (faccessat): Pretend that directories have the execute bit
+ set. Emacs expects that, e.g., in files.el:cd-absolute.
+
+ * w32proc.c (create_child): Don't clip the PID of the child
+ process to fit into an Emacs integer, as this is no longer a
+ restriction.
+ (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
+ reaping only the process specified by PID argument, if that is
+ positive. Use PID instead of dead_child to know which process to
+ reap. Wait for the child to die only if WNOHANG is not in
+ OPTIONS.
+ (sys_select): Don't set dead_child.
+
+ * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
+ as it is no longer needed.
+
+ * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
+ no longer needed.
+ (record_child_status_change): Remove the setting of
+ record_at_most_one_child for the !WNOHANG case.
+
+2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix problems in ns port found by static checking.
+ * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
+ (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
+ not to process group.
+ (ns_select): Use emacs_write, not write, as that's more robust
+ in the presence of signals.
+ (fd_handler:): Check for read errors.
+
+2012-11-16 Glenn Morris <rgm@gnu.org>
+
+ * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
+
+2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * eval.c (Finteractive_p): Revert lexbind-merge mishap.
+
+2012-11-16 Eli Zaretskii <eliz@gnu.org>
+
+ * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
+ use the same value of thread handle.
+ (start_timer_thread): If the timer thread exited (due to error),
+ clean up by closing the two handles it used. Duplicate the caller
+ thread's handle here, so it gets duplicated only once, when
+ launching the timer thread. Set priority of the timer thread, not
+ the caller thread.
+ (getitimer): Don't duplicate the caller thread's handle here.
+ (Bug#12832)
+
+2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
+ called (Bug#12834).
+
+2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ Remove no-longer-used pty_max_bytes variable.
+ * process.c (pty_max_bytes): Remove; unused.
+ (send_process): Do not set it.
+
+2012-11-15 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
+ Update dependencies.
+
+2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
+ This follows up on the 2012-09-29 patch that removed indirection
+ for the 'function' field. Reported by Sergey Vinokurov in
+ <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
+
+2012-11-14 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
+ different name, as the MS runtime does not have such a function,
+ and probably never will.) All callers changed. Ignore DIRFD
+ value if PATH is an absolute file name, to match Posix spec
+ better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
+ symlinks.
+
+2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (echo_area_display, redisplay_internal):
+ Omit redundant check whether frame_garbaged is set.
+
+2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use faccessat, not access, when checking file permissions (Bug#12632).
+ This fixes a bug that has been present in Emacs since its creation.
+ It was reported by Chris Torek in 1983 even before GNU Emacs existed,
+ which must set some sort of record. (Torek's bug report was against
+ a predecessor of GNU Emacs, but GNU Emacs happened to have the
+ same common flaw.) See Torek's Usenet posting
+ "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
+ Posted: Fri Apr 8 14:18:56 1983.
+ * Makefile.in (LIB_EACCESS): New macro.
+ (LIBES): Use it.
+ * callproc.c (init_callproc):
+ * charset.c (init_charset):
+ * fileio.c (check_existing, check_executable, check_writable)
+ (Ffile_readable_p):
+ * lread.c (openp, load_path_check):
+ * process.c (allocate_pty):
+ * xrdb.c (file_p):
+ Use effective UID when checking permissions, not real UID.
+ * callproc.c (init_callproc):
+ * charset.c (init_charset):
+ * lread.c (load_path_check, init_lread):
+ Test whether directories are accessible, not merely whether they exist.
+ * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
+ * fileio.c (check_existing, check_executable, check_writable)
+ (Ffile_readable_p):
+ Use symbolic names instead of integers for the flags, as they're
+ portable now.
+ (check_writable): New arg AMODE. All uses changed.
+ Set errno on failure.
+ (Ffile_readable_p): Use faccessat, not stat + open + close.
+ (Ffile_writable_p): No need to call check_existing + check_writable.
+ Just call check_writable and then look at errno. This saves a syscall.
+ dir should never be nil; replace an unnecessary runtime check
+ with an eassert. When checking the parent directory of a nonexistent
+ file, check that the directory is searchable as well as writable, as
+ we can't create files in unsearchable directories.
+ (file_directory_p): New function, which uses 'stat' on most platforms
+ but faccessat with D_OK (for efficiency) if WINDOWSNT.
+ (Ffile_directory_p, Fset_file_times): Use it.
+ (file_accessible_directory_p): New function, which uses a single
+ syscall for efficiency.
+ (Ffile_accessible_directory_p): Use it.
+ * xrdb.c (file_p): Use file_directory_p.
+ * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
+ * lread.c (openp): When opening a file, use fstat rather than
+ stat, as that avoids a permissions race. When not opening a file,
+ use file_directory_p rather than stat.
+ (dir_warning): First arg is now a usage string, not a format.
+ Use errno. All uses changed.
+ * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
+ that merely introduced a race.
+ * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
+ changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
+ and similarly for the other O_* flags.
+ * w32.c (sys_faccessat): Rename from sys_access and switch to
+ faccessat's API. All uses changed.
+ * xrdb.c: Do not include <sys/stat.h>; no longer needed.
+ (magic_db): Rename from magic_file_p.
+ (magic_db, search_magic_path): Return an XrmDatabase rather than a
+ char *, so that we don't have to test for file existence
+ separately from opening the file for reading. This removes a race
+ fixes a permission-checking problem, and simplifies the code.
+ All uses changed.
+ (file_p): Remove; no longer needed.
+
+2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Omit glyphs initialization at startup.
+ * dispnew.c (glyphs_initialized_initially_p): Remove.
+ (adjust_frame_glyphs_initially): Likewise. Adjust users.
+ (Fredraw_frame): Move actual code from here...
+ (redraw_frame): ...to here. Add eassert. Adjust comment.
+ (Fredraw_display): Use redraw_frame.
+ * xdisp.c (clear_garbaged_frames): Likewise.
+
+2012-11-13 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
+ passed to pint2str and pint2hrstr to be at most the size of the
+ frame's decode_mode_spec_buffer. This avoids crashes with very
+ large values of FIELD_WIDTH argument to decode_mode_spec.
+ (Bug#12867)
+
+2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix a race with verify-visited-file-modtime (Bug#12863).
+ Since at least 1991 Emacs has ignored an mtime difference of no
+ more than one second, but my guess is that this was to work around
+ file system bugs that were fixed long ago. Since the race is
+ causing problems now, let's remove that code.
+ * fileio.c (Fverify_visited_file_modtime): Do not accept a file
+ whose time stamp is off by no more than a second. Insist that the
+ file time stamps match exactly.
+
+2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * frame.h (struct frame): Convert external_tool_bar member to
+ 1-bit unsigned bitfield.
+ * termhooks.h (struct terminal): Remove mouse_moved member since
+ all users are long dead. Adjust comment on mouse_position_hook.
+
+2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Simplify by using FOR_EACH_FRAME here and there.
+ * frame.c (next_frame, prev_frame, other_visible_frames)
+ (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
+ * w32term.c (x_window_to_scroll_bar): Likewise.
+ * window.c (window_list): Likewise.
+ * xdisp.c (x_consider_frame_title): Likewise.
+ * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
+ * xfns.c (x_window_to_frame, x_any_window_to_frame)
+ (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
+ * xmenu.c (menubar_id_to_frame): Likewise.
+ * xselect.c (frame_for_x_selection): Likewise.
+ * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
+ (x_window_to_menu_bar): Likewise.
+ * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
+
+2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data.c (Qdefalias_fset_function): Now static.
+
+ Another tweak to vectorlike_header change.
+ * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
+ Remove, and replace all uses with ...
+ (next_in_free_list, set_next_in_free_list):
+ New functions, which respect C's aliasing rules better.
+
+2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * window.c (list4i): Rename from 'quad'. All uses changed.
+ Needed because <sys/types.h> defines 'quad' on Solaris 10.
+
+2012-11-11 Juanma Barranquero <lekktu@gmail.com>
+
+ * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
+ warning about mixing declarations and code in ISO C90.
+
+2012-11-10 Martin Rudalics <rudalics@gmx.at>
+
+ * window.c (Fsplit_window_internal): Set combination limit of
+ new parent window to t iff Vwindow_combination_limit is t;
+ fixing a regression introduced with the change from 2012-09-22.
+ (Fset_window_combination_limit): Fix doc-string.
+
+2012-11-10 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
+ amount when the scroll margins are too large. When scrolling
+ backwards in the buffer, give up if cannot reach point or the
+ scroll margin within a reasonable number of screen lines.
+ Fixes point position in window under scroll-up/down-aggressively when
+ point is positioned many lines beyond the window top/bottom.
+ (Bug#12811)
+
+ * ralloc.c (relinquish): If real_morecore fails to return memory
+ to the system, don't crash; instead, leave the last heap
+ unchanged and return. (Bug#12774)
+
+2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * lisp.h (AUTOLOADP): New macro.
+ * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
+ * data.c (Ffset): Remove special ad-advice-info handling.
+ (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
+ (Fsubr_arity): CSE.
+ (Finteractive_form): Simplify.
+ (Fquo): Don't insist on having at least 2 arguments.
+ (Qdefalias_fset_function): New var.
+
+2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
+
+ * image.c (xpm_make_color_table_h): Change to hashtest_equal.
+
+ * nsfont.m (Qcondensed, Qexpanded): New variables.
+ (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
+ (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
+
+2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Fix recently introduced crash on MS-Windows (Bug#12839).
+ * w32term.h (struct scroll_bar): Use convenient header.
+ (SCROLL_BAR_VEC_SIZE): Remove.
+ * w32term.c (x_scroll_bar_create): Use VECSIZE.
+
2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
Tweak last vectorlike_header change.
2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
- * nsfont.m (ns_descriptor_to_entity): Qcondesed and Qexpanded has
+ * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
been removed, so remove them here also.
2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>