Fix bug #18277 with mouse clicks on R2L lines.

 src/dispnew.c (buffer_posn_from_coords): Fix mirroring of X
 coordinate for hscrolled R2L screen lines.
Avoid inflooping in redisplay caused by hscrolled R2L lines.

 src/xdisp.c (display_line): Don't assume that the call to
 reseat_at_next_visible_line_start ends up at a character
 immediately following the newline on the previous line.  Avoids
 setting the ends_at_zv_p flag on screen lines that are not at or
 beyond ZV, which causes infloop in redisplay.  For the details, see
 http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00368.html.
* lisp/simple.el (self-insert-uses-region-functions): Defvar.
Fix bug #18276 with vertical motion through a display property.

 src/indent.c (Fvertical_motion): Fix vertical motion up through a
 display property after a newline.
src/xdisp.c (handle_stop): Improve commentary.
* lisp/progmodes/python.el (python-shell-prompt-detect): Remove redundant
executable-find.
* python-tests.el (python-shell-calculate-exec-path-2): Update test
for today's python.el changes.
Update Emacs's bidirectional conformance per Unicode 6.3.0.

 doc/lispref/display.texi (Bidirectional Display): Update the Emacs's class
 of bidirectional conformance.
Backport: * configure.ac (HAVE_XPM): Explain the use of CPPFLAGS in the Cygwin-w32 build.  (Bug#18302)
Fix compilation warnings about snprintf in the MSDOS build.

 msdos/sed2v2.inp [DJGPP <= 2.03]: Add a prototype for snprintf, to
 avoid compilation warning from newer GCC versions that have
 snprintf as a built-in.  Reported by Juan Manuel Guerrero
 <juan.guerrero@gmx.de>.
Add string collation.

* configure.ac: Check also for the uselocale function. 

* src/fns.c (Fstring_collate_lessp, Fstring_collate_equalp): New DEFUNs.

* src/sysdep.c (str_collate): New function.  (Bug#18051)
Mention the new functions `string-collate-lessp' and `string-collate-equalp'.
Make ">>" act as double template ender in C++ Mode.
cc-langs.el (c->-op-cont-tokens): New lang-const split off from
c->-op-cont-re.
(c->-op-cont-tokens): Change to use the above.
(c->-op-without->-cont-regexp): New lang-const.
    
cc-engine.el (c-forward-<>-arglist-recur): Use
c->-op-without->-cont-regexp in place of c->-op-cont-tokens.
Handle C++11's "auto" and "decltype" constructions.
cc-engine.el (c-forward-type): Enhance to recognise and return 'decltype.
(c-forward-decl-or-cast-1): New let variables backup-kwd-sym,
prev-kwd-sym, new-style-auto.  Enhance to handle the new "auto" keyword.
    
cc-fonts.el (c-font-lock-declarations): Handle the "decltype" keyword.
(c-font-lock-c++-new): Handle "decltype" constructions.
    
cc-langs.el (c-auto-ops, c-auto-ops-re): New c-lang-defconsts/defvars.
(c-haskell-op, c-haskell-op-re): New c-lang-defconsts/defvars.
(c-typeof-kwds, c-typeof-key): New c-lang-defconsts/defvars.
(c-typeless-decl-kwds): Append "auto" onto the C++ value.
(c-not-decl-init-keywords): Also exclude c-typeof-kwds from value.
Remove reference to obsolete configure scripts

* INSTALL.REPO: Remove reference to obsolete configure scripts
on non-Posix platforms.
* lisp/replace.el (query-replace): Fix typo in docstring.
Fix docstring of `remq'

* lisp/subr.el (remq): Fix docstring.
Minor cleanups of str_collate fix.

* fns.c (str_collate): Move decl from here ...
* lisp.h (str_collate): ... to here.
* sysdep.c (str_collate): Prune away some of the forest of ifdefs.
Remove unnecessary casts.  Use SAFE_NALLOCA to avoid
potential problems with integer overflow.  Don't assume
setlocale succeeds.  Remove unnecessary test before restoring
locale via setlocale, and free the copied setlocale string
when done with it.
One more minor cleanup of font subsystem.
* font.h (struct font_driver): Convert text_extents to
return void because returned value is never actually used.
* macfont.c (macfont_text_extents):
* w32font.c (w32font_text_extents):
* xftfont.c (xftfont_text_extents): Adjust to return void
and assume that 'metrics' argument is always non-NULL.
* ftfont.c (ftfont_text_extents):
* xfont.c (xfont_text_extents): Likewise.  Avoid redundant memset.
Implement locale-sensitive string collation for MS-Windows.  (Bug#18051)

 src/w32proc.c (get_lcid_callback, get_lcid, w32_compare_strings):
 New functions.
 src/w32.h (w32_compare_strings): Add prototype.
 src/w32.c <g_b_init_compare_string_w>: New global flag.
 (globals_of_w32): Initialize it.
 src/sysdep.c (str_collate) [WINDOWSNT]: Implementation for MS-Windows.
 src/fns.c (Fstring_collate_lessp, Fstring_collate_equalp)
 [WINDOWSNT]: Call str_collate on MS-Windows.

 etc/NEWS: Mention that string-collate-* functions are supported on
 MS-Windows as well.