]> code.delx.au - gnu-emacs-elpa/commitdiff
counsel.el (counsel--async-command): Add sentinel and filter args
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 23 Feb 2016 08:03:33 +0000 (09:03 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 23 Feb 2016 08:03:33 +0000 (09:03 +0100)
Re #394

counsel.el

index 53c3170e062dccf093686a120db6ee14431436d4..258ecbff9dbbff9b64a2d39d083e23d8e1be0c88 100644 (file)
@@ -66,7 +66,7 @@
   "Store the time when a new process was started.
 Or the time of the last minibuffer update.")
 
-(defun counsel--async-command (cmd)
+(defun counsel--async-command (cmd &optional process-sentinel process-filter)
   (let* ((counsel--process " *counsel*")
          (proc (get-process counsel--process))
          (buff (get-buffer counsel--process)))
@@ -79,8 +79,8 @@ Or the time of the last minibuffer update.")
                 counsel--process
                 cmd))
     (setq counsel--async-time (current-time))
-    (set-process-sentinel proc #'counsel--async-sentinel)
-    (set-process-filter proc #'counsel--async-filter)))
+    (set-process-sentinel proc (or process-sentinel #'counsel--async-sentinel))
+    (set-process-filter proc (or process-filter #'counsel--async-filter))))
 
 (defun counsel--async-sentinel (process event)
   (if (string= event "finished\n")