* lisp/minibuffer.el: Add metadata method to completion tables.
(completion-category-overrides): New defcustom.
(completion-metadata, completion--field-metadata)
(completion-metadata-get, completion--styles)
(completion--cycle-threshold): New functions.
(completion-try-completion, completion-all-completions):
Add `metadata' argument to choose completion-styles.
(completion--do-completion): Use metadata to choose cycling.
(completion-all-sorted-completions): Use metadata for sorting.
Remove :completion-cycle-penalty which is not needed any more.
(completion--try-word-completion): Add `metadata' argument.
(minibuffer-completion-help): Check metadata for annotation function
and sorting.
(completion-file-name-table): Return `category' metadata.
(minibuffer-completing-file-name): Make obsolete.
* lisp/simple.el (minibuffer-completing-symbol): Make obsolete.
* lisp/icomplete.el (icomplete-completions): Pass new `metadata' param to
completion-try-completion.
* src/minibuf.c (Finternal_complete_buffer): Return `category' metadata.
(read_minibuf): Use get_minibuffer.
(syms_of_minibuf): Use DEFSYM.
(Qmetadata): New var.
* src/data.c (Qbuffer): Don't make it static.
(syms_of_data): Use DEFSYM.