[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d8da9c4 188/272: counsel.el (counsel-mode): Allow use of d
From: |
Oleh Krehel |
Subject: |
[elpa] master d8da9c4 188/272: counsel.el (counsel-mode): Allow use of describe-prefix-bindings |
Date: |
Mon, 25 Apr 2016 10:13:24 +0000 |
branch: master
commit d8da9c4b6b5ed69b4967994be26ea382780e5a29
Author: justbur <address@hidden>
Commit: justbur <address@hidden>
counsel.el (counsel-mode): Allow use of describe-prefix-bindings
Add option to let counsel-descbinds override describe-bindings in
counsel-mode.
counsel.el (counsel-descbinds): Make signature match describe-bindings
counsel.el (counsel--descbinds-cands): Adjust for previous change
counsel.el (counsel-mode-override-describe-bindings): New option
---
counsel.el | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/counsel.el b/counsel.el
index 7d11eb4..cea7f4e 100644
--- a/counsel.el
+++ b/counsel.el
@@ -632,8 +632,8 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
(defvar counsel-descbinds-history nil
"History for `counsel-descbinds'.")
-(defun counsel--descbinds-cands ()
- (let ((buffer (current-buffer))
+(defun counsel--descbinds-cands (&optional prefix buffer)
+ (let ((buffer (or buffer (current-buffer)))
(re-exclude (regexp-opt
'("<vertical-line>" "<bottom-divider>" "<right-divider>"
"<mode-line>" "<C-down-mouse-2>" "<left-fringe>"
@@ -642,7 +642,7 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
res)
(with-temp-buffer
(let ((indent-tabs-mode t))
- (describe-buffer-bindings buffer))
+ (describe-buffer-bindings buffer prefix))
(goto-char (point-min))
;; Skip the "Key translations" section
(re-search-forward "")
@@ -679,11 +679,11 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
(counsel-info-lookup-symbol (symbol-name cmd))))
;;;###autoload
-(defun counsel-descbinds ()
+(defun counsel-descbinds (&optional prefix buffer)
"Show a list of all defined keys, and their definitions.
Describe the selected candidate."
(interactive)
- (ivy-read "Bindings: " (counsel--descbinds-cands)
+ (ivy-read "Bindings: " (counsel--descbinds-cands prefix buffer)
:action #'counsel-descbinds-action-describe
:history 'counsel-descbinds-history
:caller 'counsel-descbinds))
@@ -1886,6 +1886,12 @@ An extra action allows to switch to the process buffer."
"Map for `counsel-mode'. Remaps built-in functions to counsel
replacements.")
+(defcustom counsel-mode-override-describe-bindings nil
+ "Whether to override `describe-bindings' when `counsel-mode' is
+active."
+ :group 'ivy
+ :type 'boolean)
+
;;;###autoload
(define-minor-mode counsel-mode
"Toggle Counsel mode on or off.
@@ -1895,7 +1901,13 @@ replacements. "
:group 'ivy
:global t
:keymap counsel-mode-map
- :lighter " counsel")
+ :lighter " counsel"
+ (if counsel-mode
+ (when (and (fboundp 'advice-add)
+ counsel-mode-override-describe-bindings)
+ (advice-add #'describe-bindings :override #'counsel-descbinds))
+ (when (fboundp 'advice-remove)
+ (advice-remove #'describe-bindings #'counsel-descbinds))))
(provide 'counsel)
- [elpa] master 9aee83a 105/272: ivy.el (ivy-completion-in-region): Bind completion-ignore-case, (continued)
- [elpa] master 9aee83a 105/272: ivy.el (ivy-completion-in-region): Bind completion-ignore-case, Oleh Krehel, 2016/04/25
- [elpa] master 2a1ef54 148/272: ivy-dispatching-done should not permanently modify default action index, Oleh Krehel, 2016/04/25
- [elpa] master 5eaf787 078/272: doc/ivy.org: Improve the Texinfo/HTML export structure, Oleh Krehel, 2016/04/25
- [elpa] master b7c40d3 152/272: ivy.el (ivy-resume): Add a guard against null :action, Oleh Krehel, 2016/04/25
- [elpa] master 2ab9c54 197/272: ivy.el (ivy--switch-buffer-matcher): Fix, Oleh Krehel, 2016/04/25
- [elpa] master db00518 270/272: Bump version to 0.8.0, Oleh Krehel, 2016/04/25
- [elpa] master 96828c2 100/272: ivy.el (ivy-read): Identify extra-actions by caller as well, Oleh Krehel, 2016/04/25
- [elpa] master d425392 178/272: Correctly expand the file name at point, Oleh Krehel, 2016/04/25
- [elpa] master 8201f36 224/272: ivy.el (ivy-occur-revert-buffer): Improve for counsel-git-grep, Oleh Krehel, 2016/04/25
- [elpa] master 20f11b7 159/272: New command ivy-occur-revert-buffer bound to "g", Oleh Krehel, 2016/04/25
- [elpa] master d8da9c4 188/272: counsel.el (counsel-mode): Allow use of describe-prefix-bindings,
Oleh Krehel <=
- [elpa] master ab795d0 265/272: Don't highlight that match in the file name part, Oleh Krehel, 2016/04/25
- [elpa] master 255457a 177/272: Fixed counsel-list-processes-action-switch to use correct buffer., Oleh Krehel, 2016/04/25
- [elpa] master 48b5638 129/272: ivy.el (ivy-next-history-element): Don't add symbol bounds for file names, Oleh Krehel, 2016/04/25
- [elpa] master 41dfae6 194/272: ivy.el (ivy--format-function-generic): Fix doc, Oleh Krehel, 2016/04/25
- [elpa] master f0de338 198/272: ivy.el (ivy--directory-done): Fix when ivy-text is a dir, Oleh Krehel, 2016/04/25
- [elpa] master 67224c0 171/272: counsel.el (counsel-prompt-function): New defcustom, Oleh Krehel, 2016/04/25
- [elpa] master 0c5f68c 183/272: counsel.el (counsel-pt): Add, Oleh Krehel, 2016/04/25
- [elpa] master 692002d 184/272: counsel.el (counsel-pt): Remove unused args, Oleh Krehel, 2016/04/25
- [elpa] master 0bad922 083/272: Provide the :caller in most calls to ivy-read, Oleh Krehel, 2016/04/25
- [elpa] master dabd1f8 205/272: ivy.el (ivy-avy): Make "C-g" cancel gracefully, Oleh Krehel, 2016/04/25