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

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

[elpa] master b48a09d 245/272: Use Ivy to browse eshell and shell histor


From: Oleh Krehel
Subject: [elpa] master b48a09d 245/272: Use Ivy to browse eshell and shell history entries
Date: Mon, 25 Apr 2016 10:13:28 +0000

branch: master
commit b48a09d9a0aec5a4e26dd25d6470bf6583f02dd6
Author: manuel-uberti <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Use Ivy to browse eshell and shell history entries
---
 counsel.el |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/counsel.el b/counsel.el
index 4620c1e..76daf6d 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1896,6 +1896,27 @@ And insert it into the minibuffer. Useful during
     (ivy-read "Expr: " (delete-dups read-expression-history)
               :action #'insert)))
 
+(defun browse-history (elements)
+  "Use Ivy to navigate through ELEMENTS."
+  (setq ivy-completion-beg (point))
+  (setq ivy-completion-end (point))
+  (ivy-read "Symbol name: "
+            (delete-dups
+             (ring-elements elements))
+            :action #'ivy-completion-in-region-action))
+
+;;;###autoload
+(defun counsel-esh-history ()
+  "Browse Eshell history."
+  (interactive)
+  (browse-history eshell-history-ring))
+
+;;;###autoload
+(defun counsel-shell-history ()
+  "Browse shell history."
+  (interactive)
+  (browse-history comint-input-ring))
+
 ;;* Misc OS
 ;;** `counsel-rhythmbox'
 (defvar helm-rhythmbox-library)



reply via email to

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