Install fixes for Bug#12764 and Bug#12766.

* window.el (quit-restore-window): If the window has been
created on an existing frame and ended up as the sole window on
that frame, do not delete it (Bug#12764).

* minibuf.c (read_minibuf): Restore current buffer since
choose_minibuf_frame calling Fset_frame_selected_window may
change it (Bug#12766).
* dbusbind.c: Fix cut'n'waste error.  Use HAVE_DBUS_VALIDATE_INTERFACE.
Fix crash when using Emacs as commit editor for git.

* callproc.c (setpgrp): Remove macro, as we now use setpgid
and it is configured in conf_post.h.
(Fcall_process): Don't invoke both setsid and setpgid; the former
is enough, if it exists.
* callproc.c (Fcall_process, child_setup):
* process.c (create_process): Use setpgid.
* conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
for the real thing.
* dispnew.c (init_display): Initialize the foreground group
if we are running a tty display.
* emacs.c (main): Do not worry about setpgrp; init_display does it now.
* lisp.h (init_foreground_group): New decl.
* sysdep.c (inherited_pgroup): New static var.
(init_foreground_group, tcsetpgrp_without_stopping)
(narrow_foreground_group, widen_foreground_group): New functions.
(init_sys_modes): Narrow foreground group.
(reset_sys_modes): Widen foreground group.
Spelling fixes.
Lispref updates for some things no longer being special forms

* doc/lispref/eval.texi (Special Forms): No longer special forms:
defmacro, defun, save-window-excursion, with-output-to-temp-buffer.

* doc/lispref/functions.texi (Defining Functions): Defun is now a macro.
Defalias is a function.
lispref xref update

* doc/lispref/modes.texi (Defining Minor Modes):
"Generalized Variables" section is now in this manual rather than cl.texi.
Small lispref update for cl-lib namespace changes

* doc/lispref/errors.texi (Standard Errors):
* doc/lispref/loading.texi (Autoload): Update for cl-lib namespace changes.
* doc/lispref/lists.texi (Sets And Lists): Point xref to better location.
* doc/lispref/control.texi (Catch and Throw): Add xref to cl.texi.
Trivial ert.texi update for cl-lib namespace

* doc/misc/ert.texi (Introduction, The @code{should} Macro):
Refer to "cl-assert" rather than "assert".
* doc/misc/cl.texi (Modify Macros, Function Bindings): Add some xrefs.
* doc/misc/cl.texi: General copyedits for style, line-breaks, etc.
Replace "..." by @dots; car by @sc{car}, etc.
Fix for gomoku-display-statistics.

* play/gomoku.el (gomoku-display-statistics): Update mode line
only if in Gomoku buffer; don't capitalize "won".
More edits for cl.texi

* doc/misc/cl.texi: More copyedits, plus:
(Time of Evaluation, Iteration): Add xref to Emacs Lisp manual.
(Macro Bindings, Blocks and Exits): Acknowledge existence of lexical-binding.
(Iteration): Mainly defer to doc of standard dolist, dotimes.
Auto-commit of loaddefs files.
Fix MS-Windows build broken by fixing bug #12776 on Posix platforms.

 src/w32proc.c (getpgrp, setpgid): New functions.

 nt/inc/unistd.h (setpgid, getpgrp): Provide prototypes.
 nt/config.nt (GETPGRP_VOID): Define to 1.
Add new type 'typed-pseudovector'.
Merge branch 'typed-pseudovector' of https://github.com/larsbrinkhoff/emacs into typed-pseudovector