This simplifies Emacs a bit, since it no longer needs to worry
about closing file descriptors by hand in some cases.
It also fixes some unlikely races. Not all such races, as
libraries often open files internally without setting
close-on-exec, but it's an improvement.
* admin/merge-gnulib (GNULIB_MODULES): Add fcntl, pipe2.
(GNULIB_TOOL_FLAGS): Avoid binary-io, close. Do not avoid fcntl.
* configure.ac (mkostemp): New function to check for.
(PTY_OPEN): Pass O_CLOEXEC to posix_openpt.
* lib/fcntl.c, lib/getdtablesize.c, lib/pipe2.c, m4/fcntl.m4:
* m4/getdtablesize.m4, m4/pipe2.m4: New files, taken from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* nt/gnulib.mk: Remove empty gl_GNULIB_ENABLED_verify section;
otherwise, gnulib-tool complains given close-on-exec changes.
* nt/inc/ms-w32.h (pipe): Remove.
* nt/mingw-cfg.site (ac_cv_func_fcntl, gl_cv_func_fcntl_f_dupfd_cloexec)
(gl_cv_func_fcntl_f_dupfd_works, ac_cv_func_pipe2): New vars.
* src/alloc.c (valid_pointer_p) [!WINDOWSNT]:
* src/callproc.c (Fcall_process) [!MSDOS]:
* src/emacs.c (main) [!DOS_NT]:
* src/nsterm.m (ns_term_init):
* src/process.c (create_process):
Use 'pipe2' with O_CLOEXEC instead of 'pipe'.
* src/emacs.c (Fcall_process_region) [HAVE_MKOSTEMP]:
* src/filelock.c (create_lock_file) [HAVE_MKOSTEMP]:
Prefer mkostemp with O_CLOEXEC to mkstemp.
* src/callproc.c (relocate_fd) [!WINDOWSNT]:
* src/emacs.c (main): Use F_DUPFD_CLOEXEC, not plain F_DUPFD.
No need to use fcntl (..., F_SETFD, FD_CLOEXEC), since we're
now using pipe2.
* src/filelock.c (create_lock_file) [! HAVE_MKOSTEMP]:
Make the resulting file descriptor close-on-exec.
* src/lisp.h, src/lread.c, src/process.c (close_load_descs, close_process_descs):
* src/lread.c (load_descriptor_list, load_descriptor_unwind):
Remove; no longer needed. All uses removed.
* src/process.c (SOCK_CLOEXEC): Define to 0 if not supplied by system.
(close_on_exec, accept4, process_socket) [!SOCK_CLOEXEC]:
New functions.
(socket) [!SOCK_CLOEXEC]: Supply a substitute.
(Fmake_network_process, Fnetwork_interface_list):
(Fnetwork_interface_info, server_accept_connection):
Make newly-created socket close-on-exec.
* src/sysdep.c (emacs_open, emacs_fopen):
Make new-created descriptor close-on-exec.
* src/w32.c (fcntl): Support F_DUPFD_CLOEXEC well enough for Emacs.
* src/w32.c, src/w32.h (pipe2): Rename from 'pipe', with new flags arg.
Fixes: debbugs:14803
lisp/simple.el (default-font-height, window-screen-lines): New
functions.
(line-move, line-move-partial): Use them instead of
frame-char-height and window-text-height. This makes scrolling
text smoother when the buffer's default face uses a font that is
different from the frame's default font.
2013-07-06 Lars Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Group Parameters): Mention regexp
substitutions (bug#11688).
2013-07-06 Nathan Trapuzzano <nbtrap@nbtrap.com> (tiny change)
* gnus.texi (Generic Marking Commands): Fix grammar (bug#13368).
2013-07-06 Lars Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Emacsen): Fix version.
* gnus-faq.texi (FAQ 1-6): Mention the correct Emacs version.
2013-07-06 Lars Ingebrigtsen <larsi@gnus.org>
* gnus-art.el (gnus-block-private-groups): Allow `global' methods to
display images.
* gnus.el (gnus-valid-select-methods): Mark nnrss as global.
* message.el (message-cancel-news): According to
<mailman.216.1372942181.12400.help-gnu-emacs@gnu.org>, "cancel" is
preferred over "cmsg cancel" in the Subject.
* nnir.el (nnir-engines): Note that the group specs are regexps
(bug#13238).
* gnus-msg.el (gnus-copy-article-buffer): If the article buffer has
gotten read-only text properties, ensure that those aren't heeded when
copying stuff over (bug#13434).
* mm-view.el (mm-inline-text-html): Don't bug out on multipart messages
(bug#13762).
(manual-misc-html): Special-case ccmode and efaq.
(manual-html-mono, manual-html-node, manual-pdf, manual-ps):
Move creation of output directory here from make-manuals.
(manual-html-fix-index-2): Avoid dynamic reference to `f'.
it does its own dialog, which can't be cancelled.
* src/nsfns.m: Remove panelOK.
(ns_fd_data): New.
(ns_run_file_dialog): New function.
(Fns_read_file_name): Fill in ns_fd_data, post an event and start the
event loop, so file dialog is popped up by ns_run_file_dialog, called
by sendEvent (Bug#14578).
(EmacsSavePanel, EmacsOpenPanel): Remove ok and cancel methods.
* src/nsterm.h (NSSavePanel): Update comment.
(NSAPP_DATA2_RUNFILEDIALOG): Define.
(ns_run_file_dialog): Declare.
* src/nsterm.m (sendEvent:): Handle NSAPP_DATA2_RUNFILEDIALOG.
(window-state-put-stale-windows): New variable.
(window--state-put-2): Save list of windows without matching buffer.
(window-state-put): Remove "bufferless" windows if possible.
(ido-enable-virtual-buffers): New variable.
(ido-buffer-internal, ido-toggle-virtual-buffers)
(ido-make-buffer-list): Use it.
(ido-exhibit): Support turning on and off virtual buffers
automatically.
src/xdisp.c (default_line_pixel_height): New function.
(pos_visible_p, move_it_vertically_backward, try_scrolling)
(try_cursor_movement, redisplay_window, try_window)
(try_window_id): Use it instead of FRAME_LINE_HEIGHT. (Bug#14771)
src/window.c (window_scroll_pixel_based): use
default_line_pixel_height.
src/dispextern.h (default_line_pixel_height): Add prototype.
src/frame.c (x_set_line_spacing): Accept a float value for
line-spacing parameter, per the documentation.
(file-notify-test-remote-temporary-file-directory): Use
`null-device' on w32.
(file-notify--test-tmpfile, file-notify--test-tmpfile1)
(file-notify--test-results, file-notify--test-event)
(file-notify--deftest-remote, file-notify--event-test)
(file-notify--test-event-handler)
(file-notify--test-make-temp-name): Renamed, in order to mark them
internal.
(tramp-message-show-message, tramp-read-passwd): Tweak them for
better fitting in noninteractive tests.
(file-notify-test00-availability): Renamed from `file-notify-test0'.
(file-notify-test01-add-watch): Renamed from `file-notify-test1'.
Use `temporary-file-directory '.
(file-notify-test01-add-watch-remote): New test.
(file-notify-test02-events): Renamed from `file-notify-test2'.
(file-notify-test02-events-remote): Renamed from `file-notify-test3'.
(file-notify-test03-autorevert): Renamed from
`file-notify-test4'. Use timeouts.
(file-notify-test03-autorevert-remote): Renamed from
`file-notify-test5'.
mode command and externally. Fix various related bugs. Clarify
Commentary and improve some documentation strings and code.
(todo-delete-file): New command.
(todo-check-file): New function.
(todo-show): Handle external deletion of the file we're trying to
show. Replace called-interactively-p by an optional
prefix argument to avoid problematic interaction with catch form
when byte compiled (bug#14702).
(todo-quit): Handle external deletion of the archive's todo file.
Make sure the buffer that was visiting the archive file is still
live before trying to bury it.
(todo-category-completions): Handle external deletion of any
category completion files.
(todo-jump-to-category, todo-basic-insert-item): Recalculate list
of todo files, in case of external deletion.
(todo-add-file): Replace unnecessary setq by let-binding.
(todo-find-archive): Check whether there are any archives.
Replace unnecessary setq by let-binding.
(todo-archive-done-item): Use find-file-noselect to get the
archive buffer whether or not the archive already exists. Remove
superfluous code. Use file size instead of buffer-file-name to
check if the archive is new; if it is, update list of archives.
(todo-default-todo-file): Allow nil to be a valid value for when
there are no todo files.
(todo-reevaluate-default-file-defcustom): Use corrected definition
of todo-default-todo-file.
(todo-key-bindings-t+a+f): Add key binding for todo-delete-file.
(todo-delete-category, todo-show-categories-table)
(todo-category-number): Clarify comment.
(todo-filter-items): Clarify documentation string.
(todo-show-current-file, todo-display-as-todo-file)
(todo-reset-and-enable-done-separator): Tweak documentation string.
(todo-done-separator): Make separator length window-width, since
bug#2749 is now fixed.
Fixes: debbugs:14688
both "gvfs-monitor-dir" and "inotifywait".
(tramp-sh-file-inotifywait-process-filter): Renamed from
`tramp-sh-file-notify-process-filter'.
(tramp-sh-file-gvfs-monitor-dir-process-filter)
(tramp-get-remote-gvfs-monitor-dir): New defuns.
* doc/lispintro/emacs-lisp-intro.texi (Top):
Move WWW_GNU_ORG section outside @copying, update URL.
* doc/lispref/elisp.texi (Top): Move WWW_GNU_ORG section outside @copying.
@copying appears as a comment on every page, there is no need for the
WWW_GNU_ORG stuff to be in there.
* image.c (scale_image_size) [HAVE_IMAGEMAGICK]: New function.
(compute_image_size): Use it. Define only if HAVE_IMAGEMAGICK.
Be more careful about avoiding undefined behavior after
integer overflow and division by zero.
* emacs.c (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
Do not clear _malloc_thread_enabled_p, undoing the previous change,
which did not work (see <http://bugs.gnu.org/14569#307>).
(main): Do not invoke malloc_enable_thread if (! CANNOT_DUMP
&& (!noninteractive || initialized)). This attempts to thread
the needle between the Scylla of FreeBSD and the Charybdis of Cygwin.
call of `occur-read-primary-args' to interactive spec.
* lisp/ibuffer.el (ibuffer-mode-map): Bind "M-s a C-o" to
`ibuffer-do-occur' like in buff-menu.el.
Fixes: debbugs:14673