Fix hashing of vectors to run in bounded time.

* libguile/hash.c (SCM_MIN): New macro.
  (scm_hasher): In vector case, do nothing if d is 0.  Make sure to
  recurse with a reduced d.  Move the loop out of the 'if'.
Bump user-visible copyright years to 2014.

* doc/ref/guile.texi: Add 2014 to list of copyright years in @copying
  section.

* module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to
  2014.

* module/system/repl/common.scm (*version*): Add 2014 to the range of
  copyright years.
Fix hashing of empty vectors.

Fixes a bug introduced in cc1cd04f8111c306cf48b93e131d5c1765c808a3
"Fix hashing of vectors to run in bounded time."

* libguile/hash.c (scm_hasher): Avoid division by zero.

* test-suite/tests/hash.test ("hash"): Add tests.
Fix 'exact-integer?' comment in numbers.test.

* test-suite/tests/numbers.test: Fix 'exact-integer?' comment.
'port-position' works on CBIPs that do not support 'set-port-position!'.

* libguile/r6rs-ports.c (cbp_seek)[WHENCE == SEEK_CUR]: Break out of the
  switch statement when OFFSET is zero.
  Pass 'scm_wrong_type_arg_msg' a phrase suitable for use after
  "expecting".
* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports")["custom binary
  input port supports `port-position', not `set-port-position!'"]: New
  test.
Add srfi-16 and srfi-30 to %cond-expand-features.

* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-16 and
  srfi-30.

* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-16 and srfi-30 to the
  list of core features.

* module/srfi/srfi-16.scm: Remove call to 'cond-expand-provide'.
read: Support R7RS '#true' and '#false' syntax for booleans.

* libguile/read.c (try_read_ci_chars): New static function.
  (scm_read_boolean, scm_read_array): Use 'try_read_ci_chars'.

* doc/ref/api-data.texi (Booleans): Update docs.

* test-suite/tests/reader.test ("reading"): Add tests.
read: Accept "\|" in string literals.

* libguile/read.c (scm_read_string): Accept "\|" in string literals.

* doc/ref/api-data.texi (String Syntax): Add "\|" to the list of
  supported backslash escapes.

* test-suite/tests/reader.test ("reading"): Add test.
Recognize 'escape' character name, per R7RS.

* libguile/chars.c (scm_r7rs_charnames, scm_r7rs_charnums):
  New static constants.
  (SCM_N_R7RS_CHARNAMES): New macro.
  (scm_i_charname, scm_i_charname_to_char): Adapt to new R7RS
  char names.

* doc/ref/api-data.texi (Characters): Document #\escape.

* test-suite/tests/reader.test ("reading"): Add test.
read: use 'c_tolower' instead of 'tolower' in 'try_read_ci_chars'.

* libguile/read.c: Include <c-ctype.h>.
  (try_read_ci_chars): Use 'c_tolower' instead of 'tolower'.
Document that we support srfi-62 and add it to %cond-expand-features.

* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-62.

* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-62 to the list of core
  features.
  (SRFI-62): New node.
read: Support R7RS |...| symbol notation.

* libguile/private-options.h (SCM_R7RS_SYMBOLS_P): New macro.
  (SCM_N_READ_OPTIONS): Increment.

* libguile/read.c (scm_read_opts): Add entry for 'r7rs-symbols'.
  (t_read_opts): Add field for 'r7rs_symbols_p'.
  (scm_read_string_like_syntax): New function based on earlier
  'scm_read_string' that handles either string literals or R7RS quoted
  symbols (delimited by vertical bars), depending on the value of 'chr'.
  (scm_read_string): Reimplement based on 'scm_read_string_like_syntax'.
  (scm_read_r7rs_symbol): New static function.

* doc/ref/api-data.texi (Symbol Read Syntax): Briefly describe the R7RS
  symbol syntax, mention the 'r7rs-symbols' read option, and give some
  examples.

* doc/ref/api-evaluation.texi (Scheme Read): Mention the 'r7rs-symbols'
  read option.

* test-suite/tests/reader.test ("reading"): Add test.
print: Support R7RS |...| symbol notation.

* libguile/print.c (scm_print_opts): Add 'r7rs-symbols' print option.
  (symbol_has_extended_read_syntax): If the 'r7rs-symbols' option is
  enabled, then disallow '|' and '\' from bare symbols.
  (print_extended_symbol): Use 'scm_lfwrite' and 'scm_putc' instead of
  'display_string' and 'display_character' when printing ASCII literals.
  (print_r7rs_extended_symbol): New static function.
  (scm_i_print_symbol_name): If the 'r7rs-symbols' option is enabled,
  use 'print_r7rs_extended_symbol' instead of 'print_extended_symbol'.

* libguile/private-options.h (SCM_PRINT_R7RS_SYMBOLS_P): New macro.
  (SCM_N_PRINT_OPTIONS): Increment.

* doc/ref/api-evaluation.texi (Scheme Write): Mention 'r7rs-symbols'
  print option.

* test-suite/tests/print.test ("write"): Add tests.
print: In R7RS |...| symbols, print most graphic characters unescaped.

* libguile/print.c (print_r7rs_extended_symbol): Print any unicode
  graphic character other than '|' or '\' unescaped.  Escape any spacing
  character other than ASCII space.
Document that we support srfi-87 and add it to %cond-expand-features.

* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-87.

* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-87 to the list of core
  features.
  (SRFI-87): New node.
Document that we support srfi-46 and add it to %cond-expand-features.

* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-46.

* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-46 to the list of core
  features.
  (SRFI-46): New node.

* doc/ref/api-macros.texi (Syntax Rules): Mention that the custom
  ellipsis identifier support is specified by SRFI-46.

* test-suite/tests/syntax.test ("syntax-rules"): Add ellipsis hygiene
  test from SRFI-46.
Custom binary input ports sanity-check the return value of 'read!'.

* libguile/r6rs-ports.c (cbip_fill_input): Throw an exception when
  C_OCTETS is greater than what was requested.
* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports")["custom binary
  input port 'read!' returns too much"]: New test.
web: Don't throw if a response is longer than its Content-Length says.

* module/web/response.scm (make-delimited-input-port): Read at most LEN
  bytes from PORT, instead of trying to read more and returning an error
  if more is available.  Try again when 'get-bytevector-n!' return zero.
* test-suite/tests/web-response.test (example-1): Add garbage after the
  body itself.
Arrange so that 'file-encoding' does not truncate the encoding name.

Fixes <http://bugs.gnu.org/16463>.
Reported by Sree Harsha Totakura <sreeharsha@totakura.in>.

* libguile/read.c (ENCODING_NAME_MAX_SIZE): New macro.
  (SCM_ENCODING_SEARCH_SIZE): Change to 500 + ENCODING_NAME_MAX_SIZE.
  (scm_i_scan_for_encoding): Return NULL if there's less than
  ENCODING_NAME_MAX_SIZE bytes once "coding: *" has been read.
* test-suite/tests/coding.test ("line
  comment")["http://bugs.gnu.org/16463"]: New test.
Thank Sree Harsha.