branch: externals/corfu commit 257d9d519463a231187c0e5f9c6ba2e74582d0ea Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Revert "Rename corfu-info to corfu-doc-buffer" This reverts commit c63d92f141613c537ccdd3182efdedf307a9e0d4. --- README.org | 8 ++++---- corfu.el | 4 ++-- extensions/{corfu-doc-buffer.el => corfu-info.el} | 24 +++++++++++------------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.org b/README.org index d997cf991c..f879f24c7d 100644 --- a/README.org +++ b/README.org @@ -427,8 +427,8 @@ shown. The keymap defines the following remappings and bindings: - ~previous-line~, =up=, =M-p= -> ~corfu-previous~ - ~completion-at-point~, =TAB= -> ~corfu-complete~ - =RET= -> ~corfu-insert~ -- =M-g= -> ~corfu-doc-buffer-location~ -- =M-h= -> ~corfu-doc-buffer-documentation~ +- =M-g= -> ~corfu-info-location~ +- =M-h= -> ~corfu-info-documentation~ - =M-SPC= -> ~corfu-insert-separator~ - =C-g= -> ~corfu-quit~ - ~keyboard-escape-quit~ -> ~corfu-reset~ @@ -445,10 +445,10 @@ be enabled manually if desired. Furthermore it is possible to install all of the files separately, both ~corfu.el~ and the ~corfu-*.el~ extensions. Currently the following extensions come with the Corfu ELPA package: +- [[https://github.com/minad/corfu/blob/main/extensions/corfu-doc-popup.el][corfu-doc-popup]]: Display candidate documentation in a popup. - [[https://github.com/minad/corfu/blob/main/extensions/corfu-history.el][corfu-history]]: =corfu-history-mode= to remember selected candidates and to improve sorting. - [[https://github.com/minad/corfu/blob/main/extensions/corfu-indexed.el][corfu-indexed]]: =corfu-indexed-mode= to select indexed candidates with prefix arguments. -- [[https://github.com/minad/corfu/blob/main/extensions/corfu-doc-buffer.el][corfu-doc-buffer]]: Actions to access the candidate location and documentation. -- [[https://github.com/minad/corfu/blob/main/extensions/corfu-doc-popup.el][corfu-doc-popup]]: Display candidate documentation in a popup. +- [[https://github.com/minad/corfu/blob/main/extensions/corfu-info.el][corfu-info]]: Actions to access the candidate location and documentation. - [[https://github.com/minad/corfu/blob/main/extensions/corfu-quick.el][corfu-quick]]: Commands to select using Avy-style quick keys. See the Commentary of those files for configuration details. diff --git a/corfu.el b/corfu.el index 2913f360a5..c5f8cbd51a 100644 --- a/corfu.el +++ b/corfu.el @@ -240,8 +240,8 @@ The completion backend can override this with (define-key map "\C-g" #'corfu-quit) (define-key map "\r" #'corfu-insert) (define-key map "\t" #'corfu-complete) - (define-key map "\M-g" 'corfu-doc-buffer-location) - (define-key map "\M-h" 'corfu-doc-buffer-documentation) + (define-key map "\M-g" 'corfu-info-location) + (define-key map "\M-h" 'corfu-info-documentation) (define-key map "\M- " #'corfu-insert-separator) map) "Corfu keymap used when popup is shown.") diff --git a/extensions/corfu-doc-buffer.el b/extensions/corfu-info.el similarity index 82% rename from extensions/corfu-doc-buffer.el rename to extensions/corfu-info.el index 7f3193b721..fe34494a99 100644 --- a/extensions/corfu-doc-buffer.el +++ b/extensions/corfu-info.el @@ -1,4 +1,4 @@ -;;; corfu-doc-buffer.el --- Show candidate information in separate buffer -*- lexical-binding: t -*- +;;; corfu-info.el --- Show candidate information in separate buffer -*- lexical-binding: t -*- ;; Copyright (C) 2022 Free Software Foundation, Inc. @@ -27,8 +27,8 @@ ;;; Commentary: ;; This Corfu extension provides commands to show additional information to the -;; candidates in a separate buffer. The commands `corfu-doc-buffer-location' and -;; `corfu-doc-buffer-documentation' are bound by default in the `corfu-map' to M-g and +;; candidates in a separate buffer. The commands `corfu-info-location' and +;; `corfu-info-documentation' are bound by default in the `corfu-map' to M-g and ;; M-h respectively. ;;; Code: @@ -37,7 +37,7 @@ (eval-when-compile (require 'subr-x)) -(defun corfu-doc-buffer--restore-on-next-command () +(defun corfu-info--restore-on-next-command () "Restore window configuration before next command." (let ((config (current-window-configuration)) (other other-window-scroll-buffer) @@ -53,7 +53,7 @@ (add-hook 'pre-command-hook restore))) ;;;###autoload -(defun corfu-doc-buffer-documentation () +(defun corfu-info-documentation () "Show documentation of current candidate." (interactive) ;; Company support, taken from `company.el', see `company-show-doc-buffer'. @@ -62,13 +62,13 @@ (if-let* ((fun (plist-get corfu--extra :company-doc-buffer)) (res (funcall fun (nth corfu--index corfu--candidates)))) (let ((buf (or (car-safe res) res))) - (corfu-doc-buffer--restore-on-next-command) + (corfu-info--restore-on-next-command) (setq other-window-scroll-buffer (get-buffer buf)) (set-window-start (display-buffer buf t) (or (cdr-safe res) (point-min)))) (user-error "No documentation available"))) ;;;###autoload -(defun corfu-doc-buffer-location () +(defun corfu-info-location () "Show location of current candidate." (interactive) ;; Company support, taken from `company.el', see `company-show-location'. @@ -77,7 +77,7 @@ (if-let* ((fun (plist-get corfu--extra :company-location)) (loc (funcall fun (nth corfu--index corfu--candidates)))) (let ((buf (or (and (bufferp (car loc)) (car loc)) (find-file-noselect (car loc) t)))) - (corfu-doc-buffer--restore-on-next-command) + (corfu-info--restore-on-next-command) (setq other-window-scroll-buffer buf) (with-selected-window (display-buffer buf t) (save-restriction @@ -90,8 +90,8 @@ (user-error "No candidate location available"))) ;; Emacs 28: Do not show Corfu commands with M-X -(put #'corfu-doc-buffer-location 'completion-predicate #'ignore) -(put #'corfu-doc-buffer-documentation 'completion-predicate #'ignore) +(put #'corfu-info-location 'completion-predicate #'ignore) +(put #'corfu-info-documentation 'completion-predicate #'ignore) -(provide 'corfu-doc-buffer) -;;; corfu-doc-buffer.el ends here +(provide 'corfu-info) +;;; corfu-info.el ends here