lisp/*: Add declarations, remove unused bindings, mark unused args.

* lisp/avoid.el (mouse-avoidance-mode): Mark unused arg.
  (mouse-avoidance-nudge-mouse): Remove unused binding.

* lisp/imenu.el (imenu-default-goto-function): Mark unused args.
  (imenu-progress-message): Remove obsolete macro; all callers changed.

* lisp/mouse.el (mouse-menu-major-mode-map):
* lisp/emacs-lisp/authors.el (authors-scan-change-log)
  (authors-add-to-author-list):
* lisp/emacs-lisp/avl-tree.el (avl-tree--enter-balance):
* lisp/emacs-lisp/smie.el (smie-auto-fill):
* lisp/mail/sendmail.el (mail-bury):
* lisp/mail/unrmail.el (unrmail):
* lisp/net/tls.el (open-tls-stream):
* lisp/textmodes/picture.el (picture-mouse-set-point):
  Remove unused bindings.

* lisp/subr.el (keymap-canonicalize): Remove unused binding.
  (read-passwd): Mark unused arg.

* lisp/tutorial.el (tutorial--display-changes): Remove unused binding.
  (tutorial--save-tutorial-to): Remove unused variable.

* lisp/emacs-lisp/package.el (define-package, package-menu-mark-delete)
  (package-menu-mark-install, package-menu-mark-unmark): Mark unused args.
  (package-generate-autoloads, package-menu--generate)
  (package-menu--find-upgrades): Remove unused bindings.

* lisp/emulation/cua-rect.el (cua-restrict-regexp-rectangle)
  (cua-restrict-prefix-rectangle): Doc fixes.  Remove unused bindings.
  (cua--mouse-ignore, cua--delete-rectangle, cua--extract-rectangle)
  (cua--indent-rectangle, cua-open-rectangle, cua-close-rectangle)
  (cua-blank-rectangle, cua-string-rectangle, cua-replace-in-rectangle)
  (cua-incr-rectangle, cua-sequence-rectangle, cua--convert-rectangle-as)
  (cua--rectangle-aux-replace, cua--left-fill-rectangle)
  (cua-scroll-rectangle-up, cua-scroll-rectangle-down)
  (cua-delete-char-rectangle): Mark unused args.
  (cua-align-rectangle): Remove unused binding.

* lisp/mail/rmail.el (compilation--message->loc)
  (epa--find-coding-system-for-mime-charset): Declare.

* lisp/net/dbus.el (dbus-register-service): Declare.
  (dbus-name-owner-changed-handler): Remove unused binding.

* lisp/nxml/nxml-mode.el (nxml-electric-slash, nxml-in-mixed-content-p)
  (nxml-compute-indent-from-matching-start-tag): Remove unused variables.
  (nxml-scan-backward-within): Mark unused arg.
  (nxml-dynamic-markup-word): Remove unused binding.
Move functions from C to Lisp.  Make non-blocking method calls
the default.  Implement further D-Bus standard interfaces.

* configure.in (dbus_validate_bus_name, dbus_validate_path)
(dbus_validate_interface, dbus_validate_member): Check also for
these library functions

* dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
(QCdbus_request_name_allow_replacement)
(QCdbus_request_name_replace_existing)
(QCdbus_request_name_do_not_queue)
(QCdbus_request_name_reply_primary_owner)
(QCdbus_request_name_reply_in_queue)
(QCdbus_request_name_reply_exists)
(QCdbus_request_name_reply_already_owner): Move to dbus.el.
(QCdbus_registered_serial, QCdbus_registered_method)
(QCdbus_registered_signal): New Lisp objects.
(XD_DEBUG_MESSAGE): Use sizeof.
(XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
(XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
(XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
(XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
(XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
(xd_signature, xd_append_arg): Allow float for integer types.
(xd_get_connection_references): New function.
(xd_get_connection_address): Rename from xd_initialize.  Return
cached address.
(xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
(xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
level.
(Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
Return number of recounts.
(Fdbus_get_unique_name): Make stronger parameter check.
(Fdbus_message_internal): New defun.
(Fdbus_call_method, Fdbus_call_method_asynchronously)
(Fdbus_method_return_internal, Fdbus_method_error_internal)
(Fdbus_send_signal, Fdbus_register_service)
(Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
(xd_read_message_1): Obey new structure of Vdbus_registered_objects.
(xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
(Vdbus_compiled_version, Vdbus_runtime_version)
(Vdbus_message_type_invalid, Vdbus_message_type_method_call)
(Vdbus_message_type_method_return, Vdbus_message_type_error)
(Vdbus_message_type_signal): New defvars.
(Vdbus_registered_buses, Vdbus_registered_objects_table): Adapt
docstring.

* net/dbus.el (dbus-message-internal): Declare function.  Remove
unneeded function declarations.
(defvar dbus-message-type-invalid, dbus-message-type-method-call)
(dbus-message-type-method-return, dbus-message-type-error)
(dbus-message-type-signal): Declare variables.  Remove local
definitions.
(dbus-interface-dbus, dbus-interface-peer)
(dbus-interface-introspectable, dbus-interface-properties)
(dbus-path-emacs, dbus-interface-emacs, dbus-return-values-table):
Adapt docstring.
(dbus-interface-objectmanager): New defconst.
(dbus-call-method, dbus-call-method-asynchronously)
(dbus-send-signal, dbus-method-return-internal)
(dbus-method-error-internal, dbus-register-service)
(dbus-register-signal, dbus-register-method): New defuns, moved
from dbusbind.c
(dbus-call-method-handler, dbus-setenv)
(dbus-get-all-managed-objects, dbus-managed-objects-handler): New
defuns.
(dbus-call-method-non-blocking): Make it an obsolete function.
(dbus-unregister-object, dbus-unregister-service)
(dbus-handle-event, dbus-register-property)
(dbus-property-handler): Obey the new structure of
`bus-registered-objects'.
(dbus-introspect): Use `dbus-call-method'.  Use a timeout.
(dbus-get-property, dbus-set-property, dbus-get-all-properties):
Use `dbus-call-method'.

* dbus.texi (Version): New node.
(Properties and Annotations): Mention the object manager
interface.  Describe dbus-get-all-managed-objects.
(Type Conversion): Floating point numbers are allowed, if an
anteger does not fit Emacs's integer range.
(Synchronous Methods): Remove obsolete dbus-call-method-non-blocking.
(Asynchronous Methods): Fix description of
dbus-call-method-asynchronously.
(Receiving Method Calls): Fix some minor errors.  Add
dbus-interface-emacs.
(Signals): Describe unicast signals and the new match rules.
(Alternative Buses): Add the PRIVATE optional argument to
dbus-init-bus.  Describe its new return value.  Add dbus-setenv.
Spelling fixes.
* net/dbus.el (dbus-call-method): Restore events not from D-Bus.  (Bug#11447)
* net/dbus.el (dbus-call-method): Use timeout for `read-event'.
Otherwise, it blocks in batch mode.
Reduce use of (require 'cl).
* admin/bzrmerge.el: Use cl-lib.
* leim/quail/hangul.el: Don't require CL.
* leim/quail/ipa.el: Use cl-lib.
* vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el:
* vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el:
* register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el:
* msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el:
* international/quail.el, info-xref.el, imenu.el, image-mode.el:
* font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el:
* battery.el, avoid.el, abbrev.el: Use cl-lib.
* vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el:
* vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el:
* jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el:
* emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el:
* calculator.el, autorevert.el, apropos.el: Don't require CL.
* emacs-bytecomp.el (byte-recompile-directory, display-call-tree)
(byte-compile-unfold-bcf, byte-compile-check-variable):
* emacs-byte-opt.el (byte-compile-trueconstp)
(byte-compile-nilconstp):
* emacs-autoload.el (make-autoload): Use pcase.
* face-remap.el (text-scale-adjust): Simplify pcase patterns.
Replace version 24.2 with 24.3 where appropriate (hopefully)
Cleanup uses of "-hooks".
* doc/emacs/custom.texi (Hooks):
* doc/lispref/hooks.texi (Standard Hooks): Clarify that -hooks is deprecated.

* lisp/gnus/nndiary.el (nndiary-request-create-group-functions)
(nndiary-request-update-info-functions)
(nndiary-request-accept-article-functions):
* lisp/gnus/gnus-start.el (gnus-subscribe-newsgroup-functions):
* lisp/cedet/semantic/db-file.el (semanticdb-save-database-functions):
* lisp/cedet/semantic/lex.el (semantic-lex-reset-functions):
* lisp/cedet/semantic/edit.el (semantic-change-functions)
(semantic-edits-new-change-functions)
(semantic-edits-delete-change-functions)
(semantic-edits-reparse-change-functions):
* lisp/htmlfontify.el (hfy-post-html-hook):
* lisp/filesets.el (filesets-cache-fill-content-hook):
* lisp/arc-mode.el (archive-extract-hook):
* lisp/progmodes/cc-mode.el (c-prepare-bug-report-hook):
* lisp/net/rcirc.el (rcirc-sentinel-functions)
(rcirc-receive-message-functions, rcirc-activity-functions)
(rcirc-print-functions):
* lisp/net/dbus.el (dbus-event-error-functions):
* lisp/emacs-lisp/eieio.el (eieio-pre-method-execution-functions):
* lisp/emacs-lisp/checkdoc.el (checkdoc-style-functions)
(checkdoc-comment-style-functions): Don't use "-hooks" suffix.

* lisp/term/sun.el (sun-raw-prefix-hooks):
* lisp/mail/sendmail.el (mail-yank-hooks):
* lisp/mh-e/mh-letter.el (mh-yank-hooks): Use make-obsolete-variable.
Update copyright notices for 2013.