Skip to content

Commit

Permalink
Add helm-gid-program customization option
Browse files Browse the repository at this point in the history
On Mac OS X, "gid" might be the name of id(1) from GNU coreutils,
so add option to allow user to customize the name of gid(1).
  • Loading branch information
xuchunyang committed Oct 1, 2015
1 parent 3858790 commit a0b0e50
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions helm-id-utils.el
Expand Up @@ -24,17 +24,26 @@
"ID-Utils related Applications and libraries for Helm."
:group 'helm)

(defcustom helm-gid-program "gid"
"Name of gid command (usually `gid').
For Mac OS X users, if you install GNU coreutils, the name `gid'
might be occupied by `id' from GNU coreutils, and you should set
it to correct name (or absolute path), for example, if using
MacPorts to install id-utils, it should be `gid32'."
:group 'helm-id-utils
:type 'file)

(defcustom helm-gid-db-file-name "ID"
"Name of a database file created by `mkid' command from `ID-utils'."
:group 'helm-id-utils
:type 'string)

(defun helm-gid-candidates-process ()
(let ((proc (start-process
"gid" nil "gid"
"gid" nil helm-gid-program
"-r" helm-pattern)))
(set (make-local-variable 'helm-grep-last-cmd-line)
(format "gid -r %s" helm-pattern))
(format "%s -r %s" helm-gid-program helm-pattern))
(prog1 proc
(set-process-sentinel
proc (lambda (_process event)
Expand Down

0 comments on commit a0b0e50

Please sign in to comment.