From 07624b3c7dc8b2962976d625ba56d26c0d2f425a Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Sat, 12 Mar 2016 19:51:45 +0100 Subject: [PATCH] Fix compilation warnings --- counsel.el | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/counsel.el b/counsel.el index 96e82f83c..64baa7697 100644 --- a/counsel.el +++ b/counsel.el @@ -170,24 +170,13 @@ Update the minibuffer with the amount of lines collected every '(choice (const :tag "Plain" counsel-prompt-function-default) (const :tag "Directory" counsel-prompt-function-dir) - (function :tag "Custom"))) + (function :tag "Custom")) + :group 'ivy) (defun counsel-prompt-function-default (prompt) "Return PROMPT appended with a semicolon." (format "%s: " prompt)) -(defun counsel-prompt-function-dir (prompt) - "Return PROMPT appended with the parent directory." - (let ((directory counsel--git-grep-dir)) - (format "%s [%s]: " - prompt - (let ((dir-list (eshell-split-path directory))) - (if (> (length dir-list) 3) - (apply #'concat - (append '("...") - (cl-subseq dir-list (- (length dir-list) 3)))) - directory))))) - (defun counsel-delete-process () (let ((process (get-process " *counsel*"))) (when process @@ -752,6 +741,18 @@ Describe the selected candidate." '("git --no-pager grep --full-name -n --no-color -i -e %S") "History for `counsel-git-grep' shell commands.") +(defun counsel-prompt-function-dir (prompt) + "Return PROMPT appended with the parent directory." + (let ((directory counsel--git-grep-dir)) + (format "%s [%s]: " + prompt + (let ((dir-list (eshell-split-path directory))) + (if (> (length dir-list) 3) + (apply #'concat + (append '("...") + (cl-subseq dir-list (- (length dir-list) 3)))) + directory))))) + (defun counsel-git-grep-function (string &optional _pred &rest _unused) "Grep in the current git repository for STRING." (if (and (> counsel--git-grep-count 20000) -- 2.39.2