Fix problem with images referenced within svg files. (bug#19373)

Fixes: debbugs:19373

* src/image.c: Additional parameter 'filename' for
svg_load_image. Include "buffer.h".  Define library function
rsvg_handle_set_base_uri for WINDOWSNT.
(init_svg_functions): Initialize rsvg_handle_set_base_uri.
(fn_rsvg_handle_set_base_uri): Define fn_rsvg_handle_set_base_uri.
(svg_load): Pass a filename to svg_load_image: either name of
actual file or of current buffer's file.
(svg_load_image): New parameter 'filename', used for setting
base_uri, necessary for loading referenced images.
Introduce tramp-histfile-override.

* net/tramp-sh.el (tramp-histfile-override): New variable.
(tramp-open-shell, tramp-maybe-open-connection): Use it.
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Partially disabled previous change.

* src/image.c (svg_load): Temporarily disabled filename thing for
not-a-file case as it can cause crashs.
Fixed problems with svg_load_image -- no more crashes (hopefully)

* src/image.c (svg_load): Watch out for nil value of current buffer's
filename.  Re-enable filename thing for not-a-file case.
Add missing ChangeLog entry for prior commit.
load-history may contain nil "filenames"

* lisp/emacs-lisp/package.el (package--list-loaded-files): Handle
`(nil ...)' elements in `load-history'.
* src/keyboard.c (swallow_events): Don't redisplay if there's input pending.
* src/keyboard.c (input_was_pending): New var.

(read_char): Use it to make sure we only skip redisplay when we can't
keep up with the repeat rate.
Don't reload packages at startup

Fixes: debbugs:19390

* lisp/emacs-lisp/package.el (package-activate-1): Add RELOAD argument
and a docstring.
(package-activate): Call itself on dependencies on PACKAGE with
the same FORCE argument.  Pass FORCE as RELOAD into
`package-activate-1' .
Fix Gnus registry pruning and sorting, and rename file

* lisp/gnus/gnus-registry.el (gnus-registry-prune-factor): Add new variable.
(gnus-registry-max-pruned-entries): Remove obsolete variable.
(gnus-registry-cache-file): Change default
filename extension to "eieio".
(gnus-registry-read): Add new function, split out from
`gnus-registry-load', that does the actual object reading.
(gnus-registry-load): Use it. Add condition case handler to check for
old filename extension and rename to the new one.
(gnus-registry-default-sort-function): New variable to specify a sort
function to use when pruning.
(gnus-registry-save, gnus-registry-insert): Use it.
(gnus-registry-sort-by-creation-time): Define a default sort function.

* lisp/gnus/registry.el (registry-db): Consolidate the :max-hard and
:max-soft slots into a :max-size slot.
(registry-db-version): Add new variable for database version number.
(registry-prune): Use :max-size slot. Accept and use a sort-function
argument.
(registry-collect-prune-candidates): Add new function for finding
non-precious pruning candidates.
(registry-prune-hard-candidates, registry-prune-soft-candidates):
Remove obsolete functions.
(initialize-instance): Upgrade registry version when starting.

* doc/misc/gnus.texi (Gnus Registry Setup): Explain pruning changes.
Mention gnus-registry-prune-factor. Explain sorting changes and
gnus-registry-default-sort-function. Correct file extension.