      '("" "working..."))))
 
 ;; Like `find-dired' but taking a list of directories.
-(defun ar/find-dired (dirs args)
+(defun ar/counsel-find--dired (dpaths args)
   "Run `find' and go into Dired mode on a buffer of the output.
-The command run (after changing into DIR) is essentially
-
-    find DIRS \\( ARGS \\) -ls
-
-except that the car of the variable `find-ls-option' specifies what to
-use in place of \"-ls\" as the final argument."
-  (let ((first-dir (nth 0 dirs))
-        (dired-buffers dired-buffers))
-    ;; Expand DIR ("" means default-directory), and make sure it has a
-    ;; trailing slash.
-    (setq first-dir (file-name-as-directory (expand-file-name first-dir)))
-    ;; Check that it's really a directory.
-    (or (file-directory-p first-dir)
-	(error "find-dired needs a directory: %s" first-dir))
+The command run is essentially: find DPATHS \\( ARGS \\) -ls"
+  (let ((parent-dpath (f-common-parent dpaths))
+        (dired-buffers dired-buffers)
+        (command))
+    ;; Expand and ensure it has a trailing slash.
+    (setq parent-dpath (file-name-as-directory (expand-file-name parent-dpath)))
+    (assert (file-directory-p parent-dpath) nil
+            "find-dired needs a directory: %s" parent-dpath)
+    (setq default-directory parent-dpath)
     (pop-to-buffer-same-window (get-buffer-create "*Find*"))
-
-    ;; See if there's still a `find' running, and offer to kill
-    ;; it first, if it is.
-    (let ((find (get-buffer-process (current-buffer))))
-      (when find
-	(if (or (not (eq (process-status find) 'run))
-		(yes-or-no-p
-		 (format-message "A `find' process is running; kill it? ")))
-	    (condition-case nil
-		(progn
-		  (interrupt-process find)
-		  (sit-for 1)
-		  (delete-process find))
-	      (error nil))
-	  (error "Cannot have two processes in `%s' at once" (buffer-name)))))
-
+    ;; Kill exsiting `find' process.
+    (when (and (get-buffer-process (current-buffer))
+               (eq (process-status (get-buffer-process (current-buffer)))
+                   'run))
+      (progn
+        (interrupt-process find)
+        (sit-for 1)
+        (delete-process find)))
     (widen)
     (kill-all-local-variables)
-    (setq buffer-read-only nil)
-    (erase-buffer)
-    (setq default-directory first-dir
-	  find-args args	      ; save for next interactive call
-	  args (concat find-program " " (s-join " " dirs) " "
-		       (if (string= args "")
-			   ""
-			 (concat
-			  (shell-quote-argument "(")
-			  " " args " "
-			  (shell-quote-argument ")")
-			  " "))
-		       (if (string-match "\\`\\(.*\\) {} \\(\\\\;\\|\\+\\)\\'"
-					 (car find-ls-option))
-			   (format "%s %s %s"
-				   (match-string 1 (car find-ls-option))
-				   (shell-quote-argument "{}")
-				   find-exec-terminator)
-			 (car find-ls-option))))
-    (message args)
-    ;; Start the find process.
-    (shell-command (concat args "&") (current-buffer))
-    ;; The next statement will bomb in classic dired (no optional arg allowed)
-    (dired-mode first-dir (cdr find-ls-option))
+    (setq command (format "%s %s %s %s %s %s"
+                          find-program
+                          (s-join " " dpaths)
+                          (shell-quote-argument "(")
+                          args
+                          (shell-quote-argument ")")
+                          (car find-ls-option)))
+    (message command)
+    (shell-command (concat command "&") (current-buffer))
+    (dired-mode parent-dpath "")
     (let ((map (make-sparse-keymap)))
       (set-keymap-parent map (current-local-map))
       (define-key map "\C-c\C-k" 'kill-find)
       (use-local-map map))
-    (make-local-variable 'dired-sort-inhibit)
-    (setq dired-sort-inhibit t)
-    (set (make-local-variable 'revert-buffer-function)
-	 `(lambda (ignore-auto noconfirm)
-	    (find-dired ,dirs ,find-args)))
-    ;; Set subdir-alist so that Tree Dired will work:
-    (if (fboundp 'dired-simple-subdir-alist)
-	;; will work even with nested dired format (dired-nstd.el,v 1.15
-	;; and later)
-	(dired-simple-subdir-alist)
-      ;; else we have an ancient tree dired (or classic dired, where
-      ;; this does no harm)
-      (set (make-local-variable 'dired-subdir-alist)
-	   (list (cons default-directory (point-min-marker)))))
-    (set (make-local-variable 'dired-subdir-switches) find-ls-subdir-switches)
+    (setq-local dired-sort-inhibit t)
+    (setq-local revert-buffer-function
+                (lambda (_1 _2) `(lambda (ignore-auto noconfirm)
+                                   (ar/counsel-find--dired ,dpaths ,args))))
+    (setq-local dired-subdir-alist
+                (list (cons default-directory (point-min-marker))))
+    (setq-local dired-subdir-switches find-ls-subdir-switches)
+
     (setq buffer-read-only nil)
-    ;; dired header (title), showing find command.
-    (insert "  " args ":\n")
-    ;; Make second line a ``find'' line in analogy to the ``total'' or
-    ;; ``wildcard'' line.
+
+    (erase-buffer)
+
+    ;; Dired header.
+    (insert (format "  find in %s:\n" (s-join " " dpaths)))
+
+    ;; Dired second line is the `find' command.
     (let ((point (point)))
-      (insert "  " args "\n")
+      (insert "  " command "\n")
       (dired-insert-set-properties point (point)))
+
     (setq buffer-read-only t)
+
     (let ((proc (get-buffer-process (current-buffer))))
-      (set-process-filter proc (function find-dired-filter))
-      (set-process-sentinel proc (function find-dired-sentinel))
-      ;; Initialize the process marker; it is used by the filter.
+      (set-process-filter proc
+                          (function find-dired-filter))
+      (set-process-sentinel proc
+                            (function find-dired-sentinel))
       (move-marker (process-mark proc) (point) (current-buffer)))
     (setq mode-line-process '(":%s"))))
 

(require 'counsel)
(require 'find-dired)
(require 's)

(defvar ar/counsel-find--paths nil "Find path.")


    (define-key kmap (kbd "C-c C-e") (lambda ()
                                       (interactive)
                                       (ivy-quit-and-run
                                         (ar/counsel-find--dired ar/counsel-find--paths
                                                        ar/counsel-find--args))))
    (ivy-read "find: "
              #'ar/counsel-find--function
