;;; fwoar-helm-project.el --- helm project browser -*- lexical-binding: t; -*-
;; Copyright (C) 2020 Edward Langley
;; Author: Edward Langley <fwoar@elangley.org>
;; Version: 0.0.2
;; Keywords: helm,project
;; URL: https://fwoar.co
;; Package-Requires: (helm f dash project fwoar-functional-utils)
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Some functional programming utilities
;;; Code:
;; (defun fwoar::spotlight-validate-or-make-dummy-process (input)
;; (cond
;; ((< (length input) helm-rg-input-min-search-chars)
;; (helm-rg--make-dummy-process
;; input
;; (format "must be at least %d characters" helm-rg-input-min-search-chars)))
;; (t t)))
;; (defun fwoar::spotlight-search (s)
;; (s-split "\n" (shell-command-to-string
;; (format "mdfind %s"
;; (shell-quote-argument s)))))
;; (defun fwoar::spotlight-search ()
;; "Invoke ripgrep in `helm-rg--current-dir' with `helm-pattern'.
;; Make a dummy process if the input is empty with a clear message to the user."
;; (let* ((input helm-pattern))
;; (pcase-exhaustive (fwoar::spotlight-validate-or-make-dummy-process input)
;; ((and (pred processp) x)
;; (setq helm-rg--last-argv nil)
;; x)
;; (`t
;; (let* ((rg-regexp (helm-rg--helm-pattern-to-ripgrep-regexp input))
;; (argv (helm-rg--construct-argv rg-regexp))
;; (real-proc (helm-rg--make-process-from-argv argv)))
;; (setq helm-rg--last-argv argv)
;; real-proc)))))
;;
;; (defvar *fwoar::spotlight-source*
;; (helm-build-async-source
;; "find files with spotlight"
;; :candidates-process 'fwoar::spotlight-search
;; :action (helm-make-actions
;; "Open" #'find-file)
;; ))
;; (defun fwoar:spotlight-search ()
;; (interactive)
;; (helm (list )
;; :input ":write-image"
;; :prompt "Spotlight expression: "
;; ))
;;; fwoar-helm-project.el ends here