* lisp/minibuffer.el (completion-table-merge): New function.
* lisp/emacs-lisp/lisp.el (lisp-completion-at-point): Use
`completion-table-merge' instead of `completion-table-in-turn'.
Fixes: debbugs:16604
* lisp/emacs-lisp/lisp.el: Use lexical-binding.
(lisp--local-variables-1, lisp--local-variables): New functions.
(lisp--local-variables-completion-table): New var.
(lisp-completion-at-point): Use it to provide completion of let-bound vars.
completion tables when completing error conditions and
`declare' arguments.
(lisp-complete-symbol, field-complete): Mark as obsolete.
(check-parens): Unmatched parens are user errors.
* lisp/minibuffer.el (minibuffer-completion-contents): Mark as obsolete.
* emacs-lisp/lisp.el (narrow-to-defun): `beginning-of-defun' goes
to previous function when point is on the first character of a
function. Take care of that in `narrow-to-defun'.
Fixes: debbugs:6157
* lisp/emacs-lisp/byte-run.el (make-obsolete-variable): New argument
`access-type' and new obsolescence format.
* lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Adjust to
new format.
(byte-compile-check-variable): New `access-type' argument.
Only warn if the access-type is obsolete.
(byte-compile-dynamic-variable-bind, byte-compile-variable-ref)
(byte-compile-variable-set): Adjust callers.
* lisp/help-fns.el (describe-variable): Adjust to new obsolescence format.
* lisp/mail/sendmail.el (mail-mailer-swallows-blank-line): Only mark
setting it as obsolete.
* lisp/simple.el (minibuffer-completing-symbol):
* lisp/font-lock.el (font-lock-beginning-of-syntax-function): Only mark read
access as obsolete.
* lisp/minibuffer.el (minibuffer-completing-file-name): Don't make it
obsolete yet.
* lisp/international/quail.el (quail-mouse-choose-completion): Remove unused
code referring to obsolete var.
(quail-choose-completion-string): Remove.
* lisp/server.el (server-clients-with, server-kill-buffer-query-function)
(server-kill-emacs-query-function): Silence "unused `proc'" warnings.
* lisp/proced.el (proced-send-signal):
* lisp/emacs-lisp/lisp.el (lisp-complete-symbol):
Replace completion-annotate-function with completion-extra-properties.
(completion-at-point): New command.
* indent.el (indent-for-tab-command): Handle the new `complete' behavior.
* progmodes/python.el (python-mode-map): Use completion-at-point.
(python-completion-at-point): Rename from python-partial-symbol and
adjust for use in completion-at-point-functions.
(python-mode): Setup completion-at-point for Python completion.
* emacs-lisp/lisp.el (lisp-completion-at-point): New function
extracted from lisp-complete-symbol.
(lisp-complete-symbol): Use it.
* emacs-lisp/lisp-mode.el (emacs-lisp-mode): Use define-derived-mode,
setup completion-at-point for Elisp completion.
(emacs-lisp-mode-map, lisp-interaction-mode-map): Use completion-at-point.
* ielm.el (ielm-map): Use completion-at-point.
(inferior-emacs-lisp-mode): Setup completion-at-point for Elisp completion.
* progmodes/sym-comp.el: Move to...
* obsolete/sym-comp.el: Move from progmodes.