* w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.

Ignore 'expected'. See Eli Zaretskii in
<http://bugs.gnu.org/12471#8> (last line).
src/w32gui.h (XParseGeometry): Do not declare.
Omit unused arg EXPECTED from socket hooks.

* keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
* nsterm.m (ns_term_init):
* termhooks.h (struct terminal.read_socket_hook):
* w32inevt.c (w32_console_read_socket):
* w32term.c (w32_read_socket):
* xterm.c (XTread_socket):
Omit unused arg EXPECTED.  All callers changed.
(store_user_signal_events): Return void, not int, since callers no
longer care about the return value.  All uses changed.
* src/alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
calling mark_vectorlike since that's the one that marks the window.
(mark_discard_killed_buffers): Mark the final cdr.
* src/window.h (struct window): Move prev/next_buffers to the
non-standard fields.
* src/window.c (make_window): Initialize prev/next_buffers manually.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Fix last change.
* lisp/calc/calc.el: Remove redundant autoload shape check.
(sel-mode): Don't defvar.
(calc-get-stack-element): Add `sel-mode' arg instead.
(calc-top, calc-top-list): Pass it this additional argument.
* lisp/calc/calc-store.el (calc-store-map):
* lisp/calc/calc-map.el (calc-apply, calc-reduce, calc-map)
(calc-map-equation, calc-outer-product, calc-inner-product):
* lisp/calc/calc-aent.el (calc-alg-entry): Don't bind sel-mode.
* vc/diff.el (diff-latest-backup-file): Autoload.
* lisp/dired-aux.el (dired-diff): Remove (require 'diff) since
`diff-latest-backup-file' is now autoloaded.
Auto-commit of loaddefs files.
In debug restore assignment to debugger-old-buffer.

* emacs-lisp/debug.el (debug): Restore assignment to
debugger-old-buffer removed on 2012-09-08.
* lisp/calc/calc.el: Fix last change by removing the whole chunk, since it
was only needed back when Calc was not bundled.
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): New function.
(macroexp--expand-all): Use it.
(macroexp--funcall-and-return): Remove by folding it into its sole
caller (macroexp--warn-and-return).
* lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete):
Use macroexp--obsolete-warning.
* rst.el: Integrate support for `imenu' and `which-function'.
Fixes feature request bug#11711.

(rst-mode): Create `imenu-create-index-function'.
(rst-get-stripped-line): Delete after refactoring.
(rst-section-tree, rst-section-tree-rec)
(rst-section-tree-point): Refactor and document properly.
(rst-imenu-find-adornments-for-position)
(rst-imenu-convert-cell, rst-imenu-create-index): New
function.
* doc-view.el (doc-view-display): Better fix for the cl-assertion
error.
* lisp/replace.el (read-regexp): Don't add ": " when PROMPT already
ends with a colon and space.
* lisp/replace.el (read-regexp): Add HISTORY arg.
* lisp/replace.el (read-regexp): Rename DEFAULT-VALUE arg to DEFAULTS
and allow accepting a list of strings prepended to a list of
standard default values.  Doc fix.
* lisp/replace.el (query-replace-read-from): Use `read-regexp' instead
of `read-from-minibuffer' when `regexp-flag' is non-nil.
(occur-read-primary-args): Use `read-regexp' instead of
`read-string'.
(multi-occur-in-matching-buffers): Use `read-regexp' instead of
`read-from-minibuffer'.
* lisp/isearch.el (isearch-occur): Use `read-regexp' instead of
`read-string'.
* lisp/dired.el (dired-read-regexp): Use `read-regexp' instead of
`read-from-minibuffer'.
* lisp/progmodes/grep.el (grep-read-regexp): Use `read-regexp' instead
of `read-string'.
Merge from emacs-24; up to r108145
Merge from emacs-24; up to r108145