branch: externals/marginalia commit 3360875943e6084f134aebffad83878d71c367c5 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Rename marginalia-cycle-annotators to marginalia-cycle * The name is still meaningful * Shorter names take less space in the Embark which-key menu --- README.md | 9 ++++----- marginalia.el | 17 ++++++++--------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 117a4e8..0ddc568 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The annotations are added based on the completion category. For example `find-file` reports the `file` category and `M-x` reports the `command` category. You can choose between more or less detailed annotators, by setting the variable `marginalia-annotators` or by invoking the command -`marginalia-cycle-annotators`. +`marginalia-cycle`. Since many commands do not report a completion category themselves, Marginalia provides a classifier system, which tries to guess the correct category based @@ -40,10 +40,9 @@ commands. ~~~ elisp ;; Enable richer annotations using the Marginalia package (use-package marginalia - ;; When using the Embark package, you can bind `marginalia-cycle-annotators' - ;; as an Embark action! + ;; When using the Embark package, you can bind `marginalia-cycle' as an Embark action! ;; :bind (:map embark-general-map - ;; ("A" . marginalia-cycle-annotators)) + ;; ("A" . marginalia-cycle)) ;; The :init configuration is always executed (Not lazy!) :init @@ -55,7 +54,7 @@ commands. ;; Prefer richer, more heavy, annotations over the lighter default variant. ;; E.g. M-x will show the documentation string additional to the keybinding. ;; By default only the keybinding is shown as annotation. - ;; Note that there is the command `marginalia-cycle-annotators` to + ;; Note that there is the command `marginalia-cycle` to ;; switch between the annotators. ;; (setq marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))) ~~~ diff --git a/marginalia.el b/marginalia.el index 1d43b70..e8817ee 100644 --- a/marginalia.el +++ b/marginalia.el @@ -61,12 +61,12 @@ This value is adjusted in the `minibuffer-setup-hook' depending on the `window-w '(marginalia-annotators-light marginalia-annotators-heavy nil) "Choose an annotator association list for minibuffer completion. The first entry in the list is used for annotations. -You can cycle between the annotators using `marginalia-cycle-annotators'. +You can cycle between the annotators using `marginalia-cycle'. Annotations are only shown if `marginalia-mode' is enabled. An entry of nil disables marginalia's annotations (leaving you only with the annotations that come with Emacs) without disabling `marginalia-mode'; this can be convenient for users of -`marginalia-cycle-annotators'." +`marginalia-cycle'." :type '(repeat (choice (const :tag "Light" marginalia-annotators-light) (const :tag "Heavy" marginalia-annotators-heavy) (const :tag "None" nil) @@ -669,19 +669,18 @@ Remember `this-command' for annotation." ;; If you want to cycle between annotators while being in the minibuffer, the completion-system ;; should refresh the candidate list. Currently there is no support for this in marginalia, but it -;; is possible to advise the `marginalia-cycle-annotators' function with the necessary refreshing -;; logic. See the discussion in https://github.com/minad/marginalia/issues/10 for reference. +;; is possible to advise the `marginalia-cycle' function with the necessary refreshing logic. See +;; the discussion in https://github.com/minad/marginalia/issues/10 for reference. ;;;###autoload -(defun marginalia-cycle-annotators () +(defun marginalia-cycle () "Cycle between annotators in `marginalia-annotators'. If called from the minibuffer the annotator cycling is local, that it is, it does not affect subsequent minibuffers. When called from a regular buffer the effect is global." (interactive) - ;; If `marginalia-cycle-annotators' has been invoked from inside the minibuffer, only change - ;; the annotators locally. This is useful if the command is used as an action. If the command is - ;; not triggered from inside the minibuffer, cycle the annotator globally. Hopefully this is - ;; not too confusing. + ;; If `marginalia-cycle' has been invoked from inside the minibuffer, only change the annotators + ;; locally. This is useful if the command is used as an action. If the command is not triggered + ;; from inside the minibuffer, cycle the annotator globally. Hopefully this is not too confusing. (if-let* ((win (active-minibuffer-window)) (buf (window-buffer win))) (let ((a (buffer-local-value 'marginalia-annotators buf)))