Fix display of R2L lines in partial-width windows.

 src/xdisp.c (init_iterator): Don't use it->bidi_p before it is
 assigned the correct value.
 (extend_face_to_end_of_line): Account for truncation and
 continuation glyphs in R2L rows when one of the fringes is not
 displayed.
 (display_line): Don't assign negative X offset to a row if we are
 going to produce a truncation glyph for it.  When handling
 truncated R2L rows, consider the width of the left fringe instead
 of the right one.
 (produce_special_glyphs): Fix bogus assignments.
src/dispextern.h: Commentary fix.
Always use matched specpdl entry to record call arguments (Bug#18473).
* lisp.h (record_in_backtrace): Adjust prototype.
* eval.c (record_in_backtrace): Return current specpdl level.
(set_backtrace_args, set_backtrace_nargs): Merge.  Adjust all users.
(eval_sub, Ffuncall): Record call arguments in matched specpdl
entry and use that entry in call to backtrace_debug_on_exit.
(apply_lambda): Likewise.  Get current specpdl level as 3rd arg.
(do_debug_on_call): Get current specpdl level as 2nd arg.
Prefer ptrdiff_t to int and avoid integer overflows.
* fileio.c (make_temp_name):
* font.c (font_parse_family_registry): Avoid integer
overflow on string size calculation.
* data.c (Faset): Likewise for byte index.
Fix block cursor display in R2L lines.

 src/xterm.c (x_draw_stretch_glyph_string):
 src/w32term.c (x_draw_stretch_glyph_string): Fix a thinko that
 caused the block cursor to disappear on a TAB in R2L lines in
 every window except the leftmost one.  Reported by Martin Rudalics
 <rudalics@gmx.at>.
Fix display of hollow-box and hbar cursors on r2L lines.

 src/xterm.c (x_draw_hollow_cursor, x_draw_bar_cursor):
 src/w32term.c (x_draw_hollow_cursor, x_draw_bar_cursor): In R2L
 lines, draw the hollow-box and hbar cursors on the right side of
 cursor-glyph.  Thanks to martin rudalics <rudalics@gmx.at> for
 testing on X.
Fix `fit-window-to-buffer' (Bug#18498).

* window.el (fit-window-to-buffer): When counting buffer width,
count the whole visible buffer.  Correctly convert the body-height
to pixel size for window-text-pixel-size (Bug#18498).
Fix bug #18490 with redisplay of other windows showing a narrowed buffer.

 src/xdisp.c (redisplay_internal): Force redisplay of all windows
 that show a buffer whose narrowing has changed.
Clarify the doc strings of mouse-position and set-mouse-position.

 src/frame.c (Fmouse_position, Fset_mouse_position): Clarify the
 units in which the position is measured.  (Bug#18493)
Do not call egrep to determine emacs version in EDE.

* ede/emacs.el (ede-emacs-version): Do not call 'egrep' to
determine Emacs version (it was dead code anyway).  Make sure that
configure.ac or configure.in exist.  (Bug#18476)
* src/image.c (imagemagick_load_image): Add delay to imagemagick metadata.
(Bug#10747, bug#18334)
Clarify url-http and url-retrieve-internal docstrings

* lisp/url/url-http.el (url-http): Same. 

* lisp/url/url.el (url-retrieve-internal): Clarify the docstring.
Add the missing last name to ChangeLog
Use font-lock-face property; derive from special-mode

* lisp/textmodes/reftex-sel.el (reftex-select-label-mode)
(reftex-select-bib-mode, reftex-insert-docstruct): Derive modes
from special-mode (instead of fundamental-mode) and propertize
with font-lock-face instead of just face.

* lisp/textmodes/reftex-toc.el (reftex-toc-mode, reftex-toc): Ditto.
Auto-commit of loaddefs files.
* configure.ac: Increase headerpad_extra to 1000, update the comment
about load commands.

* src/unexmacosx.c (dump_it): Improve error message.
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Accept underscores in identifiers after "sub".
* lisp/progmodes/prog-mode.el (prog-mode-hook): Replace reference to
Text mode in docstring.
* lisp/simple.el (clone-indirect-buffer): Mention the return value.
Minor improvements to new stack-allocated Lisp objects.

* frame.h (FRAME_PARAMETER):
Prefer scoped_list1 to local_list1 where either would do.
* lisp.h (scoped_list4): New macro.
(local_cons, local_list1, local_list2, local_list3, local_list4)
(make_local_vector, make_local_string, build_local_string):
Prefer functions to macros where either would do.
* xdisp.c (build_desired_tool_bar_string):
Prefer scoped_list4 to local_list4 where either would do.