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

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

[elpa] master 9d3d7de 132/184: counsel.el (counsel-slime-repl-history):


From: Oleh Krehel
Subject: [elpa] master 9d3d7de 132/184: counsel.el (counsel-slime-repl-history): Add.
Date: Wed, 16 Oct 2019 13:15:08 -0400 (EDT)

branch: master
commit 9d3d7defe669b08d2c316ddf9c1133467e6c29af
Author: Brian Leung <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-slime-repl-history): Add.
    
    ivy.el (ivy-history-contents): Accommodate sequences.
---
 counsel.el |  9 +++++++++
 ivy.el     | 23 +++++++++++++----------
 2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/counsel.el b/counsel.el
index dbf0470..be433ef 100644
--- a/counsel.el
+++ b/counsel.el
@@ -4394,6 +4394,15 @@ An extra action allows to switch to the process buffer."
   (require 'comint)
   (counsel--browse-history comint-input-ring))
 
+(defvar slime-repl-input-history)
+
+;;;###autoload
+(defun counsel-slime-repl-history ()
+  "Browse Slime REPL history."
+  (interactive)
+  (require 'slime-repl)
+  (counsel--browse-history slime-repl-input-history))
+
 ;;** `counsel-hydra-heads'
 (defvar hydra-curr-body-fn)
 (declare-function hydra-keyboard-quit "ext:hydra")
diff --git a/ivy.el b/ivy.el
index 14b1002..c241b80 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4503,20 +4503,23 @@ This list can be rotated with 
`ivy-rotate-preferred-builders'."
     (define-key map (kbd "C-k") 'ivy-reverse-i-search-kill)
     map))
 
-(defun ivy-history-contents (sym-or-ring)
-  "Copy contents of SYM-OR-RING.
+(defun ivy-history-contents (history)
+  "Copy contents of HISTORY.
 A copy is necessary so that we don't clobber any string attributes.
-Also set `ivy--reverse-i-search-symbol' to SYM-OR-RING."
-  (setq ivy--reverse-i-search-symbol sym-or-ring)
-  (cond ((symbolp sym-or-ring)
+Also set `ivy--reverse-i-search-symbol' to HISTORY."
+  (setq ivy--reverse-i-search-symbol history)
+  (cond ((symbolp history)
          (delete-dups
-          (copy-sequence (symbol-value sym-or-ring))))
-        ((ring-p sym-or-ring)
+          (copy-sequence (symbol-value history))))
+        ((ring-p history)
          (delete-dups
-          (when (> (ring-size sym-or-ring) 0)
-            (ring-elements sym-or-ring))))
+          (when (> (ring-size history) 0)
+            (ring-elements history))))
+        ((sequencep history)
+         (delete-dups
+          (copy-sequence history)))
         (t
-         (error "Expected a symbol or a ring: %S" sym-or-ring))))
+         (error "Expected a symbol, ring, or sequence: %S" history))))
 
 (defun ivy-reverse-i-search ()
   "Enter a recursive `ivy-read' session using the current history.



reply via email to

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