Replace read-event loop with major-mode keybindings

Remove read-event loop from one-key-menu function and instead use
one-key-mode (new) to bind all keys to one-key-command (new) function.
Simplify one-key-menu function, removing some args and adding others.
Use buffer local variables (in the one-key buffer) named one-key-buffer-*
to store information for the current menu set (names, menus etc.).
Use function one-key-update-buffer-contents to update update contents
of one-key buffer.

Introduce new method to handle window toggling: new function
one-key-set-window-state sets the current state of the window, new
variable one-key-window-toggle-sequence contains sequence of toggle
states which are used to toggle the window by the one-key-menu-window-toggle
function, and variable one-key-window-toggle-pos indicates the current
position in the toggle sequence.

Change way that sort methods are stored and handled: add extra element to
menu types (as stored in one-key-types-of-menu) to hold the sort methods
for that menu type. Introduce new customization option
one-key-sort-method-indices-alist to track the current sort method for
each menu which can be saved.
Also use strings instead of symbols for sort methods keys.

Add new special keys skip-menus-left and skip-menus-right for jumping several
menus at a time.

Add new variable one-key-general-special-keybindings containing
special-keybindings that are normally used with all menus.
Use new function one-key-add-elements-to-list for creating special
key lists by adding to one-key-general-special-keybindings.
This makes it easy to add special keys to all menu types.

New utility function one-key-eval-if-symbol (self explanatory).

Functions added: one-key-eval-if-symbol, one-key-add-elements-to-list,
                 one-key-command, one-key-update-buffer-contents,
                 one-key-menu-window-toggle, one-key-reposition-window-contents,
                 one-key-set-window-state, one-key-mode

Functions removed: one-key-get-next-alist-item, one-key-handle-last,
                   one-key-menu-window-own-frame-p, one-key-menu-window-open,
                   one-key-menu-window-close

Functions altered: one-key-sort-items-by-next-method, one-key-open-menus,
                   one-key-open-menu-set, one-key-menu

Variables added: one-key-window-toggle-pos, one-key-general-special-keybindings,
                 one-key-window-toggle-sequence, one-key-window-ownframe-initial-size,
                 one-key-help-buffer-name, one-key-sort-method-indices-alist

Variables removed: one-key-menu-call-first-time, one-key-default-current-sort-method,
                   one-key-current-window-state, one-key-popup-window
Alterations for compatibility with recent changes in one-key.el

Change definition of one-key-regs-special-keybindings so that it
uses one-key-general-special-keybindings.

Replace calls to one-key-menu-window-close with calls to
one-key-set-window-state

Altered variables: one-key-regs-special-keybindings
Altered functions: one-key-regs-highlight-matching-items,
                   one-key-regs-prompt-to-add-menu-item,
                   one-key-regs-edit-menu-item,
                   one-key-regs-delete-menu-item
Alterations for compatibility with recent changes in one-key.el

Variables altered: one-key-dir-sort-method-alist,
                   one-key-dir-special-keybindings,
                   one-key-types-of-menu
Variables removed: one-key-dir-current-sort-method
Alterations for compatibility with recent changes in one-key.el

Also new function one-key-bmkp-read-tags for reading tags using ido.

Altered variables: one-key-bmkp-sort-method-alist,
                   one-key-special-keybindings,
                   one-key-bmkp-special-keybindings,
                   one-key-types-of-menu

Removed variables: one-key-bmkp-current-sort-method

New functions: one-key-bmkp-read-tags

Altered functions: one-key-bmkp-create-menu
Alteration to one-key-apropos-special-keybindings

Add special keys to one-key-general-special-keybindings instead
of listing all of them.
Fixes to special key functions

Rename all references to okm- variables to one-key-buffer- variables.
Remove unnecessary function arguments, and use one-key-buffer- variables instead.
Declare one-key-buffer- variables globally for the sake of documentation.

New variables: one-key-buffer-menu-number, one-key-buffer-menu-alists, one-key-buffer-menu-names,
               one-key-buffer-special-keybindings, one-key-buffer-associated-window,
               one-key-buffer-match-action, one-key-buffer-miss-match-action

Remove functions: one-key-scroll-or-move-up

Alter functions: one-key-show-item-help, one-key-prompt-to-add-menu-item
                 one-key-swap-menu-items, one-key-delete-menu-item, one-key-copy/kill-items,
                 one-key-yank-items, one-key-edit-menu-item, one-key-highlight-matching-items,
                 one-key-save-menu, one-key-reverse-item-order, one-key-menu-brighten-most-used,
                 one-key-menu-format, one-key-get-menu-item
Replace remove with remq where possible

Altered items:
one-key-special-keybindings, one-key-prompt-for-menu,
one-key-open-menus, one-key-execute-binding-command, one-key-read
Fix functions for adding/removing menus

Replace okm- variables with one-key-buffer- variables and a few other
minor fixes to make the following functions work with the new one-key
major-mode.

Altered items:
one-key-add-menus, one-key-get-menus, one-key-delete-menus,
one-key-delete-associated-menus, one-key-open-submenu
Fix one-key-read to work with new one-key-menu

Alter call to one-key-menu in one-key-read so that args match new
definition of one-key-menu.
Also fix documentation of one-key-menu.

Altered items:
one-key-menu, one-key-read
Fix special keys for scrolling

Use one-key-menu-window-scroll-up-line instead of next-line
and previous-line commands. Also add comma before apply-partially
call so that is expanded properly.

Altered items:
one-key-special-keybindings
Fix frame switching and menu persistence

Fix special key for toggling menu persistence, and make sure
one-key-update-buffer-contents is called after window size is changed
so that it displays properly if the one-key buffer is designated as
a special buffer to open in a new frame.
Also set action for <frame-switch> event to select previous frame in
one-key-command.

Altered items:
one-key-special-keybindings, one-key-command, one-key-set-window-state
Fix one-key-set-window-state to raise existing frame

If one-key already has a dedicated frame, and one-key-set-window-state
is called from a different frame, then the existing frame is now also
raised.

Altered items:
one-key-set-window-state
Major-mode for one-key help buffer, and related fixes

New major-mode one-key-help-mode binds keys to one-key-command
in one-key help buffer. Various fixes to other functions to make
this work properly, and so that help buffer closes if key is pressed
and one-key buffer isn't open.

Also new global variables documenting one-key buffer local variables
that I forgot to include before.

Also moved one-key-add-* functions to beginning of file since they're
needed by preceeding customization options.

Altered items:
one-key-buffer-menu-number, one-key-buffer-menu-names,
one-key-buffer-menu-alists, one-key-buffer-special-keybindings,
one-key-buffer-associated-window, one-key-buffer-match-action,
one-key-buffer-miss-match-action, one-key-buffer-dedicated-frame,
one-key-buffer-filter-regex, one-key-buffer-filtered-list,
one-key-show-help, one-key-add-elements-to-list, one-key-add-to-alist,
one-key-add-elements-to-alist, one-key-command, one-key-mode,
one-key-help-mode, one-key-set-window-state
Set local keymap properly for one-key modes

Set keymap using use-local-map function for one-key-mode,
and one-key-help-mode.

Altered items:
one-key-mode, one-key-help-mode
Fix one-key-set-window-state to show help properly

'showhelp option now works properly when help buffer doesn't already
exist.

Altered items:
one-key-set-window-state
Make help buffer display properly with dedicated frame

Fix one-key-set-window-state so that when called with 'showhelp or 'hidehelp
and one-key has a dedicated frame then the frame height is adjusted accordingly
to fit the new help buffer. Still needs polishing a bit to get the heights
exactly right.

Altered items:
one-key-set-window-state
More fixes to one-key-set-window-state

Fixes to ensure window sizes are set correctly for one-key buffer,
and one-key help buffer. Also proper handling of resizing one-key buffer
window when help window is showing. Also set maxlines correctly for text
only displays.

Altered items:
one-key-set-window-state
Change default special keys for 'quit-close and 'quit-open

If we use ESC then it blocks f-keys in text-only terminals so use q
and C-q instead.

Altered items:
one-key-special-keybindings, one-key-command, one-key-set-window-state
unset ESC key in one-key buffer

To ensure f-keys are read properly on text terminals,
unset the ESC key in one-key-mode-map.

Altered items:
one-key-command, one-key-mode
Remove whitespace

Altered items:
one-key-mode