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

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

[elpa] master 5e1c468 357/399: ivy.el (ivy--cleanup): Extract


From: Oleh Krehel
Subject: [elpa] master 5e1c468 357/399: ivy.el (ivy--cleanup): Extract
Date: Sat, 20 Jul 2019 14:57:58 -0400 (EDT)

branch: master
commit 5e1c468bba568c618e4666cc69e4d4a60967a777
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy--cleanup): Extract
---
 ivy.el | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/ivy.el b/ivy.el
index 263bb45..ffa7fb3 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2037,20 +2037,24 @@ customizations apply to the current completion session."
                    (set hist (cons (propertize item 'ivy-index ivy--index)
                                    (delete item
                                            (cdr (symbol-value hist))))))))))
-      ;; Fixes a bug in ESS, #1660
-      (put 'post-command-hook 'permanent-local nil)
-      (remove-hook 'post-command-hook #'ivy--queue-exhibit)
-      (let ((cleanup (ivy--display-function-prop :cleanup)))
-        (when (functionp cleanup)
-          (funcall cleanup)))
-      (when (setq unwind (ivy-state-unwind ivy-last))
-        (funcall unwind))
-      (ivy--pulse-cleanup)
-      (unless (eq ivy-exit 'done)
-        (ivy-recursive-restore)))
+      (ivy--cleanup))
     (ivy-call)
     (ivy--remove-props (ivy-state-current ivy-last) 'idx)))
 
+(defun ivy--cleanup ()
+  ;; Fixes a bug in ESS, #1660
+  (put 'post-command-hook 'permanent-local nil)
+  (remove-hook 'post-command-hook #'ivy--queue-exhibit)
+  (let ((cleanup (ivy--display-function-prop :cleanup))
+        (unwind (ivy-state-unwind ivy-last)))
+    (when (functionp cleanup)
+      (funcall cleanup))
+    (when unwind
+      (funcall unwind)))
+  (ivy--pulse-cleanup)
+  (unless (eq ivy-exit 'done)
+    (ivy-recursive-restore)))
+
 (defun ivy--display-function-prop (prop)
   "Return PROP associated with current `ivy--display-function'."
   (plist-get (cdr (assq ivy--display-function



reply via email to

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