Skip to content

Commit d71cca7

Browse files
committed
Add haskell-hasktags-arguments to allow customisation of command
Fixes #1576
1 parent 7cffe97 commit d71cca7

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

haskell-cabal.el

+19-8
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@
5656
:group 'haskell
5757
:type 'string)
5858

59+
(defcustom haskell-hasktags-arguments '("-e" "-x")
60+
"Additional arguments for `hasktags' executable.
61+
By default these are:
62+
63+
-e - generate ETAGS file
64+
-x - generate additional information in CTAGS file."
65+
:group 'haskell
66+
:type '(list string))
67+
5968
(defconst haskell-cabal-general-fields
6069
;; Extracted with (haskell-cabal-extract-fields-from-doc "general-fields")
6170
'("name" "version" "cabal-version" "license" "license-file" "copyright"
@@ -1122,13 +1131,12 @@ buffer not visiting a file returns nil."
11221131

11231132
(defun haskell-cabal--compose-hasktags-command (dir)
11241133
"Prepare command to execute `hasktags` command in DIR folder.
1125-
By default following parameters are passed to Hasktags
1126-
executable:
1127-
-e - generate ETAGS file
1128-
-x - generate additional information in CTAGS file.
11291134
1130-
This function takes into account user's operation system: in case
1131-
of Windows it generates simple command, relying on Hasktags
1135+
To customise the command executed, see `haskell-hasktags-path'
1136+
and `haskell-hasktags-arguments'.
1137+
1138+
This function takes into account the user's operating system: in case
1139+
of Windows it generates a simple command, relying on Hasktags
11321140
itself to find source files:
11331141
11341142
hasktags --output=DIR\TAGS -x -e DIR
@@ -1138,9 +1146,10 @@ recursively avoiding visiting unnecessary heavy directories like
11381146
.git, .svn, _darcs and build directories created by
11391147
cabal-install, stack, etc and passes list of found files to Hasktags."
11401148
(if (eq system-type 'windows-nt)
1141-
(format "%s --output=%s -x -e %s"
1149+
(format "%s --output=%s %s %s"
11421150
haskell-hasktags-path
11431151
(shell-quote-argument (expand-file-name "TAGS" dir))
1152+
(mapconcat #'identity haskell-hasktags-arguments " ")
11441153
(shell-quote-argument dir))
11451154
(format "cd %s && %s | %s"
11461155
(shell-quote-argument dir)
@@ -1161,7 +1170,9 @@ cabal-install, stack, etc and passes list of found files to Hasktags."
11611170
"-name '#*' "
11621171
"-or -name '.*' "
11631172
"\\) -print0")
1164-
(format "xargs -0 %s -e -x" (shell-quote-argument haskell-hasktags-path)))))
1173+
(format "xargs -0 %s %s"
1174+
(shell-quote-argument haskell-hasktags-path)
1175+
(mapconcat #'identity haskell-hasktags-arguments " ")))))
11651176

11661177
(provide 'haskell-cabal)
11671178
;;; haskell-cabal.el ends here

0 commit comments

Comments
 (0)