Add log2 support and make log10 obsolete for consistency.

* configure.ac (log2): Check for this function.
* doc/lispref/numbers.texi (Math Functions): Remove obsolete function log10.
* lisp/subr.el (log10): Move here from C code, and declare as obsolete.
All uses of (log10 X) replaced with (log X 10).
* src/floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the
base is 2; this is more accurate.
(Flog10): Move to Lisp (marked obsolete there).
* alloc.c (die): Move "assertion failed" string here ...

* lisp.h (eassert): ... from here.  Also, suppress evaluation of
COND when SUPPRESS_CHECKING.  This shrinks the executable text
size by 0.8% to 2.2% when configured with --enable-checking,
depending on optimization flags (GCC 4.8.1 x86-64).
Yet another attempt at fixing bugs #14602, 14630, 14669.

 src/w32fns.c (w32_wnd_proc): Don't compute the header line and mode
 line dimensions here, to avoid race conditions with the main
 thread.
 src/w32term.c (w32_draw_window_cursor): Compute the header line and
 mode line dimensions here.
 <w32_system_caret_window, w32_system_caret_hdr_height>:
 <w32_system_caret_mode_height>: New variables.
 src/w32term.h: Declare them.
* syntax.c: Integer cleanups.

(SYNTAX_FLAGS_COMMENT_STYLEC): Return a boolean, not 0-or-2.
All uses that need 0-or-2 changed to:
(SYNTAX_FLAGS_COMMENT_STYLEC2): New macro, with the same semantics
as the old SYNTAX_FLAGS_COMMENT_STYLEC.
(struct lisp_parse_state, syntax_prefix_flag_p, update_syntax_table)
(char_quoted, prev_char_comend_first, back_comment)
(Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
(in_classes, forw_comment, scan_lists, scan_sexps_forward):
Use bool for boolean.
(update_syntax_table, skip_chars, skip_syntaxes):
Prefer int to unsigned when either will do.
(back_comment): Return boolean success flag, like forw_comment,
instead of positive-or-minus-1 (which might have overflowed int anyway).
Don't stuff ptrdiff_t into int.
(syntax_spec_code, syntax_code_spec): Now const.
(Fmatching_paren, scan_lists, scan_sexps_forward):
Use enum syntaxcode for syntax code.
(Fmatching_paren): Check that arg is a character, not just an integer.
(Fstring_to_syntax): Don't assume 0377 fits in enum syntaxcode.
(Finternal_describe_syntax_value): Omit no-longer-needed
comparison to 0.
(skip_chars): Use char, not unsigned char, when the distinction
doesn't matter.
(forw_comment, scan_lists): Prefer A |= B to A = A || B when B's cheap.
* bytecode.c (exec_byte_code):
* syntax.c (syntax_spec_code, Fchar_syntax)
(Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
(init_syntax_once):
* syntax.h (SYNTAX_WITH_FLAGS):
Omit unnecessary casts.
* lisp/emacs-lisp/cl-loaddefs.el: Don't version-control any more.
* lisp/emacs-lisp/cl-lib.el: Load cl-macs when cl-loaddefs is not
yet available.
* lisp/Makefile.in (AUTOGEN_VCS): Move cl-loaddefs.el...
(AUTOGENEL): ... here.
* lisp/emacs-lisp/cl-macs.el (cl--sublis): New function.
(cl--defsubst-expand): Use it.
* .bzrignore: Don't unignore cl-loaddefs.el.
lisp/term/x-win.el (emacs-session-filename): Use `locate-user-emacs-file'.
lisp/profiler.el (profiler-format-number): Use log, not log10.
configure.ac (HAVE_LIBXML2): Try built-in libxml2 on OS X 10.8 as a fallback.
* comint.el (comint-redirect-results-list-from-process): Fix
random delay.

Fixes: debbugs:14681
Remove obsolete comments re postscript image printing
* lisp/emacs-lisp/package.el: Use tar-mode rather than tar executable.
Consolidate the single-file vs tarball code.
(package-desc-suffix): New function.
(package-desc-full-name): Don't bother inlining it.
(package-load-descriptor): Return the new package-desc.
(package-mark-obsolete): Remove unused arg `package'.
(package-unpack): Make it work for single files as well.
Make it update package-alist.
(package--make-autoloads-and-stuff): Rename from
package--make-autoloads-and-compile.  Don't compile any more.
(package--compile): New function.
(package-generate-description-file): New function, extracted from
package-unpack-single.
(package-unpack-single): Remove.
(package--with-work-buffer): Add indentation and debugging info.
(package-download-single): Remove.
(package-install-from-archive): Rename from package-download-tar, make
it take a pkg-desc, and make it work for single files as well.
(package-download-transaction): Simplify.
(package-tar-file-info): Remove `file' arg.  Rewrite not to use an
external tar program.
(package-install-from-buffer): Remove `pkg-desc' argument.
Use package-tar-file-info for tar-mode buffers.
(package-install-file): Simplify accordingly.
(package-archive-base): Change to take a pkg-desc.
* lisp/tar-mode.el (tar--check-descriptor): New function, extracted from
tar-get-descriptor.
(tar-get-descriptor): Use it.
(tar-get-file-descriptor): New function.
(tar--extract): New function, extracted from tar-extract.
(tar--extract): Use it.
* lisp/emacs-lisp/package-x.el (package-upload-file): Decode the file, in
case the summary uses non-ascii.  Adjust to new calling convention of
package-tar-file-info.
* lisp/url/url-future.el (url-future-call): Remove useless value call.

An earlier version of this function returned the value, ref
http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00708.html
but now it returns the function (see commentary).
* lisp/font-lock.el (lisp-font-lock-keywords-2): Add with-eval-after-load.
* progmodes/octave.el (octave-mode): Backward compatibility fix.
cookie1.el small cleanup

Make some funcs interactive, copy some functionality from yow.el.

* lisp/play/cookie1.el (cookie): New custom group.
(cookie-file): New option.
(cookie-check-file): New function.
(cookie): Make it interactive.  Make start and end messages optional.
Interactively, display the result.  Default to cookie-file.
(cookie-insert): Default to cookie-file.
(cookie-snarf): Make start and end messages optional.
Default to cookie-file.  Use with-temp-buffer.
(cookie-read): Rename from read-cookie.
Make start and end messages optional.  Default to cookie-file.
(cookie-shuffle-vector): Rename from shuffle-vector.  Use dotimes.
(cookie-apropos, cookie-doctor): New functions, copied from yow.el

* lisp/obsolete/yow.el (read-zippyism): Use new name for read-cookie.
ChangeLog fix for previous change
lisp/net/eww.el (eww-update-header-line-format): Quote % characters
* comint.el (comint-redirect-results-list-from-process): Fix
infinite loop.
Auto-commit of generated files.
lisp/*.el: Fix typos; use string-match-p, looking-at-p, setq-local, defvar-local.

* lisp/allout-widgets.el (allout-widgets-mode-off)
  (allout-widgets-mode-on, allout-widgets-pre-command-business)
  (allout-widgets-post-command-business)
  (allout-widgets-after-copy-or-kill-function)
  (allout-widgets-after-undo-function, allout-test-range-overlaps)
  (allout-decorate-item-and-context)
  (allout-graphics-modification-handler): Fix typos in docstrings.
  (allout-get-or-create-parent-widget): Use `looking-at-p'.

* lisp/cmuscheme.el (scheme-start-file): Doc fix.
  (inferior-scheme-mode, switch-to-scheme): Fix typos in docstrings.
  (scheme-input-filter): Use `string-match-p'.

* lisp/composite.el (compose-gstring-for-terminal): Fix typo in docstring.

* lisp/dired-x.el: Use Dired consistently in docstrings.

* lisp/dired.el: Use Dired consistently in docstrings.
  (dired-readin, dired-mode): Use `setq-local'.
  (dired-switches-alist): Make defvar-local.
  (dired-buffers-for-dir): Use `zerop'.
  (dired-safe-switches-p, dired-switches-escape-p)
  (dired-insert-old-subdirs, dired-move-to-end-of-filename)
  (dired-glob-regexp, dired-in-this-tree, dired-goto-file-1)
  (dired-sort-set-mode-line, dired-sort-toggle, dired-sort-R-check):
  (dired-goto-next-nontrivial-file): Use `string-match-p'.
  (dired-align-file, dired-insert-directory, dired-mark-files-in-region)
  (dired-toggle-marks, dired-mark-files-containing-regexp)
  (dired-mark-symlinks, dired-mark-directories, dired-mark-executables)
  (dired-flag-auto-save-files, dired-flag-backup-files):
  Use `looking-at-p'.
  (dired-mark-files-regexp, dired-build-subdir-alist):
  Use `string-match-p', `looking-at-p'.

* lisp/dos-w32.el (untranslated-canonical-name, untranslated-file-p)
  (direct-print-region-helper): Use `string-match-p'.