emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 181cd43 154/272: Add counsel-mode


From: Oleh Krehel
Subject: [elpa] master 181cd43 154/272: Add counsel-mode
Date: Mon, 25 Apr 2016 10:13:22 +0000

branch: master
commit 181cd43fbdeca28e5cc558d102b2fdf33c1aca65
Author: justbur <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Add counsel-mode
    
    A minor-mode that remaps built-in functions that have counsel
    replacements available.
    
    Fixes #414
---
 counsel.el |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/counsel.el b/counsel.el
index 46300e9..456b863 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1688,6 +1688,34 @@ An extra action allows to switch to the process buffer."
               ("e" counsel-rhythmbox-enqueue-song "Enqueue song"))
             :caller 'counsel-rhythmbox))
 
+(defvar counsel-mode-map
+  (let ((map (make-sparse-keymap)))
+    (dolist (binding
+             '((describe-bindings . counsel-descbinds)
+               (describe-function . counsel-describe-function)
+               (describe-variable . counsel-describe-variable)
+               (find-file         . counsel-find-file)
+               (imenu             . counsel-imenu)
+               (load-library      . counsel-load-library)
+               (load-theme        . counsel-load-theme)
+               (yank-pop          . counsel-yank-pop)))
+      (define-key map (vector 'remap (car binding)) (cdr binding)))
+    map)
+  "Map for `counsel-mode'. Remaps built-in functions to counsel
+replacements.")
+
+;;;###autoload
+(define-minor-mode counsel-mode
+  "Toggle Counsel mode on or off.
+Turn Counsel mode on if ARG is positive, off otherwise. Counsel
+mode remaps built-in emacs functions that have counsel
+replacements. "
+  :group 'ivy
+  :global t
+  :keymap counsel-mode-map
+  :lighter " counsel")
+
+
 (provide 'counsel)
 
 ;;; counsel.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]