* dired.c (Ffile_attributes): Return Qnil, if Fexpand_file_name
raises an error.
* net/tramp-adb.el (tramp-adb-handle-file-attributes):
* net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes):
* net/tramp-sh.el (tramp-sh-handle-file-attributes): Return nil in
case of errors.

* net/tramp.el (tramp-error-with-buffer): Show connection buffer
only when message appeared in minibuffer.
Fix wrong bound to c-font-lock-declarators.  Fixes bug #18948.
progmodes/cc-fonts.el (c-font-lock-declarations): Pass "(point-max)" as
bound to c-font-lock-declarators, not "limit", as the buffer is sometimes
narrowed to less than "limit" (e.g., in the presence of macros).
Backport fix to bug #18749 to Emacs-24 branch.
* src/xgselect.c (xg_select): Use g_main_context_acquire.
* src/syntax.c (back_comment): Fix off-by-one error.
epg: Adjust to GnuPG 2.1 key listing change
  
* epg.el (epg--list-keys-1): Ignore fields after the 15th field
(bug#18979).  Reported by Hideki Saito.

Backported from trunk.
Backport from trunk documentation of shr-color-visible-* variables.

 doc/misc/eww.texi (Advanced): Document increasing contrast with
 shr-color-visible-distance-min and shr-color-visible-luminance-min.
doc/misc/eww.texi: Fix a typo and improve wording of last commit.
* files.el (file-name-non-special): Wrap the call of
`insert-file-contents' by `unwind-protect', in order to set the
buffer's file name anyway.
* callproc.c (encode_current_directory): Support handling of file
names prepended by "/:".
* src/callproc.c (encode_current_directory): Fix thinko in previous.
* lisp/emulation/cua-base.el (cua--select-keymaps): Use region-active-p.
(cua-set-mark, cua--pre-command-handler-1,cua--post-command-handler-1):
* lisp/emulation/cua-gmrk.el (cua-cancel-global-mark): Same.
* callproc.c (encode_current_directory): Encode dir at the end.
* net/tramp.el (tramp-check-cached-permissions): Include hop in
the constructed Tramp file name.
Backport Tramp changes from trunk.

* automated/tramp-tests.el (tramp-remote-process-environment):
Declare.
(tramp--test-enabled): Ignore errors.
(tramp--instrument-test-case): Extend docstring.  Print debug
buffer in any case.
(tramp-test15-copy-directory): Skip for tramp-smb.el.
(tramp-test21-file-links): Use `file-truename' for directories.
(tramp-test26-process-file): Extend test according to Bug#17815.
(tramp-test27-start-file-process, tramp-test28-shell-command):
Retrieve process output more robustly.
(tramp-test29-vc-registered): Set $BZR_HOME.
(tramp--test-check-files): Extend test with `substitute-in-file-name'.
(tramp-test30-special-characters): Skip for tramp-adb.el,
tramp-gvfs.el and tramp-smb.el.  Add further file names.
Backport Tramp changes from trunk.

* tramp.texi (Inline methods): Remove restriction on "telnet".
Recommend sharing ssh connections for "plink".
(External methods): Remove "sftp".  Merge "pscp" and "psftp"
descriptions.  Recommend sharing ssh connections.  Add "nc" method.
(GVFS based methods): Add "sftp".
(Customizing Completion, External packages, Issues): Use @dots{}.
(Remote shell setup): Explain, how to change command line
arguments of remote "nc" listener.

* trampver.texi: Update release number.
Attempt to fix NS hang.  Will probably cause merge conflicts.

* nsterm.m (init): Replace OSX 10.9 check with IMPL_COCOA.
(run): Ditto.  Only use non-system event loop if OSX version is
exactly 10.9.
* lisp/emacs-lisp/bytecomp.el: Add a warning and remove a spurious warning.
(byte-compile-initial-macro-environment): Don't compile before eval in
`eval-and-compile'.
(byte-compile-arglist-warn): Add check for defining macros after their
first use.  Check call use even if the function is fboundp.
Merge from emacs-24; up to 117687