From 9f0f838e86169a576e903d3a41616df5ca08c3e2 Mon Sep 17 00:00:00 2001 From: Michael Xavier Date: Mon, 26 Oct 2015 18:30:13 -0700 Subject: [PATCH] Make hasktags command customizable --- haskell-commands.el | 7 ++++--- haskell-customize.el | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/haskell-commands.el b/haskell-commands.el index ab845d553..44a9eccd8 100644 --- a/haskell-commands.el +++ b/haskell-commands.el @@ -33,6 +33,7 @@ (require 'haskell-presentation-mode) (require 'haskell-utils) (require 'highlight-uses-mode) +(require 'haskell-customize) ;;;###autoload (defun haskell-process-restart () @@ -702,11 +703,11 @@ function `xref-find-definitions' after new table was generated." (haskell-session-cabal-dir (haskell-process-session (car state))))) (haskell-process-send-string (car state) - (format ":!cd %s && %s | %s" + (format ":!cd %s && %s" (haskell-session-cabal-dir (haskell-process-session (car state))) - "find . -type f \\( -name '*.hs' -or -name '*.lhs' -or -name '*.hsc' \\) -not \\( -name '#*' -or -name '.*' \\) -print0" - "xargs -0 hasktags -e -x")))) + haskell-tags-command + )))) :complete (lambda (state _response) (when (cdr state) (let ((session-tags diff --git a/haskell-customize.el b/haskell-customize.el index 6bfd67b66..658b7a3e3 100644 --- a/haskell-customize.el +++ b/haskell-customize.el @@ -404,6 +404,13 @@ same vein as `haskell-indent-spaces'." :group 'haskell :type '(repeat 'string)) +;;;###autoload +(defcustom haskell-tags-command + "find . -type f \\( -name '*.hs' -or -name '*.lhs' -or -name '*.hsc' \\) -not \\( -name '#*' -or -name '.*' \\) -print0 | xargs -0 hasktags -e -x" + "Command to run from the project root to find haskell files and generate a TAGS file" + :type 'string + :group 'haskell) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Accessor functions