branch: elpa/vcomplete commit 36ae2920e42f7df88d5fdb9ad48e7ac5166efe42 Author: Daniel Semyonov <cm...@dsemy.com> Commit: Daniel Semyonov <cm...@dsemy.com>
* vcomplete.el (vcomplete-kill-buffer): Remove to simplify the package --- NEWS | 9 ++++----- vcomplete.el | 25 ------------------------- vcomplete.texi | 16 +++------------- 3 files changed, 7 insertions(+), 43 deletions(-) diff --git a/NEWS b/NEWS index 7d900ff65d..ee229a173b 100644 --- a/NEWS +++ b/NEWS @@ -3,17 +3,16 @@ See the end of the file for an explanation of the versioning scheme. * 0.2 (in development) +** Remove vcomplete-kill-buffer. +This was done as part of an effort to simplify the code base (since +third party solutions to completions actions exist). + ** Optionally automatically update the completion list buffer. See vcomplete-auto-update's documentation string for more information. ** Fix vcomplete--setup being removed from a wrong hook when vcomplete-mode is turned off. -** Improve usability of vcomplete-kill-buffer. -Killing a buffer using it will now cause the next completion in the -list to be highlighted (or the previous one if it's the last -completion in the list). - * 0.1 ** Initial version. diff --git a/vcomplete.el b/vcomplete.el index 277b90746b..174c06b1e3 100644 --- a/vcomplete.el +++ b/vcomplete.el @@ -57,8 +57,6 @@ ;; ;; M-RET (C-M-m) chooses the completion at point. ;; -;; C-x k kills the buffer associated with the completion at point. -;; ;; More commands can be added through ‘vcomplete-command-map’: ;; ;; (define-key vcomplete-command-map [?\C-a] #'my-command) @@ -179,34 +177,11 @@ With prefix argument N, move N items (negative N means move forward)." (switch-to-completions) (choose-completion))) -(defun vcomplete-kill-buffer () - "Kill the buffer associated with the current completion (if it exists)." - (interactive) - (unless (minibufferp) - (user-error "‘vcomplete-kill-buffer’ only works in the minibuffer")) - (if-let ((buf (get-buffer vcomplete-current-completion-string)) - (index vcomplete-current-completion-index) - (enable-recursive-minibuffers t)) - (if (buffer-modified-p buf) - (when (yes-or-no-p - (format "Buffer %s modified; kill anyway? " buf)) - (kill-buffer buf) - (setq vcomplete-current-completion-index 0) - (minibuffer-completion-help) - (vcomplete--move-n-completions index)) - (kill-buffer buf) - (setq vcomplete-current-completion-index 0) - (minibuffer-completion-help) - (vcomplete--move-n-completions index)) - (user-error "‘%s’ is not a valid buffer" buf)) - (setq this-command 'vcomplete--no-update)) - (defvar vcomplete-command-map (let ((map (make-sparse-keymap))) (define-key map [?\C-n] #'vcomplete-next-completion) (define-key map [?\C-p] #'vcomplete-prev-completion) (define-key map [?\C-\M-m] #'vcomplete-choose-completion) - (define-key map [?\C-x ?k] #'vcomplete-kill-buffer) map) "Key map for ‘vcomplete-mode’ commands.") diff --git a/vcomplete.texi b/vcomplete.texi index db3cb38686..103ed4da86 100644 --- a/vcomplete.texi +++ b/vcomplete.texi @@ -168,16 +168,6 @@ Choose the current completion (@code{vcomplete-choose-completion}). This command chooses the highlighted completion, ending completion. @end table -@kindex C-x k -@cindex vcomplete-kill-buffer -@table @asis -@item @kbd{C-x k} -Kill the buffer corresponding to the current completion -(@code{vcomplete-kill-buffer}). This command kills the buffer -corresponding to the currently highlighted (or last highlighted) -completion, if such buffer exists. -@end table - @xref{Completion commands} for information regarding defining new commands. @@ -209,11 +199,11 @@ Completion commands are used to perform operations on specific completion candidates. They are normal commands (interactive functions) which are bound to a key sequence in @code{vcomplete-command-map}. @code{vcomplete-next-completion}, -@code{vcomplete-prev-completion}, @code{vcomplete-choose-completion} -and @code{vcomplete-kill-buffer} are implemented as completion +@code{vcomplete-prev-completion} and +@code{vcomplete-choose-completion} are implemented as completion commands. Completion commands can inhibit updating the completion list buffer by setting @code{this-command} to @code{vcomplete--no-update}. -Note that the completion list is updated after every command (through +Note that the completion list is updated after every command (via @code{post-command-hook}). @defvar vcomplete-command-map