[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 76fff20 114/184: counsel-M-x: Propertize names of active m
From: |
Oleh Krehel |
Subject: |
[elpa] master 76fff20 114/184: counsel-M-x: Propertize names of active modes. |
Date: |
Wed, 16 Oct 2019 13:15:02 -0400 (EDT) |
branch: master
commit 76fff20e6774f777787902030e9dcb528682078a
Author: Nathan Moreau <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel-M-x: Propertize names of active modes.
* counsel.el (counsel-active-mode): new face.
(counsel-M-x-transformer): propertize names of active modes.
Fixes #2189
Fixes #2258
---
counsel.el | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/counsel.el b/counsel.el
index 1ee165b..67ff54f 100644
--- a/counsel.el
+++ b/counsel.el
@@ -799,6 +799,11 @@ With prefix arg MODE a query for the symbol help mode is
offered."
"Face used by `counsel-M-x' for key bindings."
:group 'ivy-faces)
+(defface counsel-active-mode
+ '((t :inherit font-lock-builtin-face))
+ "Face used by `counsel-M-x' for activated modes."
+ :group 'ivy-faces)
+
(defcustom counsel-alias-expand t
"When non-nil, show the expansion of aliases in `counsel-M-x'."
:type 'boolean
@@ -806,8 +811,15 @@ With prefix arg MODE a query for the symbol help mode is
offered."
(defun counsel-M-x-transformer (cmd)
"Return CMD annotated with its active key binding, if any."
- (let ((alias (symbol-function (intern cmd)))
- (key (where-is-internal (intern cmd) nil t)))
+ (let* ((sym (intern cmd))
+ (alias (symbol-function sym))
+ (key (where-is-internal sym nil t)))
+ (when (or (eq sym major-mode)
+ (and
+ (memq sym minor-mode-list)
+ (boundp sym)
+ (buffer-local-value sym (ivy-state-buffer ivy-last))))
+ (put-text-property 0 (length cmd) 'face 'counsel-active-mode cmd))
(concat cmd
(when (and (symbolp alias) counsel-alias-expand)
(format " (%s)" alias))
- [elpa] master 560957f 074/184: Check if ivy--done is accepting a string., (continued)
- [elpa] master 560957f 074/184: Check if ivy--done is accepting a string., Oleh Krehel, 2019/10/16
- [elpa] master 3b4956a 123/184: counsel.el (counsel-evil-registers-height): Remove obsolete var, Oleh Krehel, 2019/10/16
- [elpa] master a1bb702 128/184: Nicer message when counsel-git-grep finds no match, Oleh Krehel, 2019/10/16
- [elpa] master 5d2938f 126/184: counsel.el (counsel-git-grep): Works with ivy--regex-fuzzy, Oleh Krehel, 2019/10/16
- [elpa] master 3a37741 147/184: swiper.el (swiper--update-input-ivy): Set case-fold-search, Oleh Krehel, 2019/10/16
- [elpa] master dea98fc 153/184: ivy.el (ivy-inhibit-action): Clean up docstring, Oleh Krehel, 2019/10/16
- [elpa] master 92f54f6 150/184: ivy.el (ivy-configure): Add :grep-p, Oleh Krehel, 2019/10/16
- [elpa] master abe5aa8 006/184: ivy.el (ivy-resume): Select original buffer for search functions, Oleh Krehel, 2019/10/16
- [elpa] master bfe4454 021/184: Fix swiper--isearch-filter-ignore-order return value, Oleh Krehel, 2019/10/16
- [elpa] master bb65c4e 039/184: swiper.el (swiper--current-window-start): Refactor, Oleh Krehel, 2019/10/16
- [elpa] master 76fff20 114/184: counsel-M-x: Propertize names of active modes.,
Oleh Krehel <=
- [elpa] master bfdda68 111/184: swiper.el (swiper-occur): Use ivy-occur-next-error, Oleh Krehel, 2019/10/16
- [elpa] master 84e1ab8 117/184: counsel.el (counsel-package): Refresh contents automatically, Oleh Krehel, 2019/10/16
- [elpa] master 9d3d7de 132/184: counsel.el (counsel-slime-repl-history): Add., Oleh Krehel, 2019/10/16
- [elpa] master 9e1b9a0 131/184: counsel.el (counsel-google-function): Add missing require, Oleh Krehel, 2019/10/16
- [elpa] master 5ff8b5e 133/184: ivy.el (ivy-completion-in-region-action): Use declare-function., Oleh Krehel, 2019/10/16
- [elpa] master 78dd554 134/184: ivy.el (ivy--exhibit): Handle ivy--reset-state initial call, Oleh Krehel, 2019/10/16
- [elpa] master c1ea2af 145/184: ivy.el (ivy-read): Fix conflict an existing read-key session, Oleh Krehel, 2019/10/16
- [elpa] master 589e03f 144/184: ivy.el (ivy-configure): Use for ivy-index-functions-alist, Oleh Krehel, 2019/10/16
- [elpa] master 64c0804 163/184: ivy.el (ivy-partial-or-done): Work with completion-cycle-threshold, Oleh Krehel, 2019/10/16
- [elpa] master 6f23c5e 152/184: ivy.el (ivy-occur-press): Re-use ivy-highlight-grep-commands, Oleh Krehel, 2019/10/16