Disable preview overlay before inserting.

When inserting multiple items from the `kill-ring' using
`browse-kill-ring-insert', the point is adjusted after each insert, the
preview however, remains at the original point location, this is not
great as it makes the preview less useful.

A second issue with the existing preview is that it remains in place
until after the insert is complete, only being deleted as part of the
`browse-kill-ring-quit', if the preview is combined with highlighting
the item just inserted, then the preview AND the inserted item are both
present in the users buffer for a short while, this is can be confusing,
and can cause unneeded scrolling of the window.

This commit fixes these issues by removing the preview overlay before
inserting the item into the original buffer, and then restoring the
preview in an updated location if the user is not about to quit
`browse-kill-ring'.
Split browse-kill-ring-preview-update into two.

Split browse-kill-ring-preview-update into two,
browse-kill-ring-preview-update-text and
browse-kill-ring-preview-update-by-position, this makes the worked core
available for reuse in a later commit.  Should be no user visible
changes from this commit.
When editing `kill-ring' entries update preview.

When preview is turned on, and editing entries from the `kill-ring'
update the preview live.
Factor out find item logic from browse-kill-ring.

Factor out code from `browse-kill-ring' for finding an item in the
`kill-ring', creating `browse-kill-ring-find-entry', this will be used
in a later commit.  There should be no user visible changes from this
commit.
Reselect kill-ring entry after editing.

When editing an entry from the *Kill Ring* buffer, reselect the entry
once editing is finished, or editing is aborted.
Improve deleting of the last item in kill-ring.

When deleting the last item in the *Kill Ring* buffer, delete the
preceding separator.  The buffer display is now consistent after
deleting items from the buffer.
Merge pull request #38 from T-J-Teru/select-after-edit-v2

Reselect `kill-ring` item after editing.
Merge branch 'delete-last' of github.com:T-J-Teru/browse-kill-ring into T-J-Teru-delete-last
Merge branch 'T-J-Teru-delete-last'
Merge branch 'edit-with-preview-v2' of github.com:T-J-Teru/browse-kill-ring into T-J-Teru-edit-with-preview-v2
Merge branch 'T-J-Teru-edit-with-preview-v2'
Use a kill-buffer-hook to ensure that the preview is removed.

Previously, if the `*Kill Ring*' buffer is killed in by calling
`kill-buffer' directly, rather than `browse-kill-ring-quit' then the
preview is left active.  After this patch the preview will be removed
even in this case.
Merge branch 'hide-preview-v2' of github.com:T-J-Teru/browse-kill-ring into T-J-Teru-hide-preview-v2
Merge branch 'T-J-Teru-hide-preview-v2'
Perform the quit action earlier.

Previously the `*Kill-Ring*' buffer is only closed after the item has
been inserted and the highlighting has finished (if highlighting of the
inserted item is turned on), this takes 0.5 seconds, and gives a user
experience that appears unresponsive.

After this patch when the user asks for insert and exit, we first
establish what will be inserted, then we close the `*Kill Ring*' buffer,
and then we insert and highlight the item.  This gives a much more
responsive user experience.
Merge branch 'cleanup-on-kill' of github.com:T-J-Teru/browse-kill-ring into T-J-Teru-cleanup-on-kill
Merge branch 'T-J-Teru-cleanup-on-kill'
Merge branch 'early-quit-v2' of github.com:T-J-Teru/browse-kill-ring into T-J-Teru-early-quit-v2
Merge branch 'T-J-Teru-early-quit-v2'
Fix bug in browse-kill-ring-occur.

The parameters to browse-kill-ring-setup have changed at some point in
the past, and browse-kill-ring-occur had not been update to the new
usage, with the result that browse-kill-ring-occur no longer worked.
Fixed in this commit, brings use of browse-kill-ring-setup up to date.

ChangeLog:

	Fix bug in `browse-kill-ring-occur' due to change in parameters of
	`browse-kill-ring-setup'.