@@ -1079,52 +1079,45 @@ buffer not visiting a file returns nil."
1079
1079
(when buffer-file-name
1080
1080
(file-name-directory buffer-file-name))))
1081
1081
1082
- (defun haskell-cabal--compose-hasktags-command (&optional cabal- dir )
1083
- " Prepare command to execute hasktags for current file .
1082
+ (defun haskell-cabal--compose-hasktags-command (dir )
1083
+ " Prepare command to execute ` hasktags` command in DIR folder .
1084
1084
By default following parameters are passed to Hasktags
1085
1085
executable:
1086
1086
-e - generate ETAGS file
1087
1087
-x - generate additional information in CTAGS file.
1088
1088
1089
- Tries to find cabal file location, give optional CABAL-DIR parameter to
1090
- override it. If cabal file not found uses current file
1091
- directory if current buffer is visiting a file. Otherwise returns nil.
1092
-
1093
1089
This function takes into account user's operation system: in case
1094
- of Windows it generates simple command like
1090
+ of Windows it generates simple command, relying on Hasktags
1091
+ itself to find source files:
1095
1092
1096
1093
hasktags --output=DIR\T AGS -x -e DIR
1097
1094
1098
- relying on Hasktags itself to find source files;
1099
-
1100
1095
In other cases it uses `find` command to find all source files
1101
1096
recursively avoiding visiting unnecessary heavy directories like
1102
1097
.git, .svn, _darcs and build directories created by
1103
- cabal-install, stack, etc."
1104
- (let ((dir (or cabal-dir (haskell-cabal--find-tags-dir))))
1105
- (when dir
1106
- (if (eq system-type 'windows-nt )
1107
- (format " hasktags --output=\" %s \\ TAGS\" -x -e \" %s \" " dir dir)
1108
- (format " cd %s && %s | %s "
1109
- dir
1110
- (concat " find . "
1111
- " -type d \\ ( "
1112
- " -path ./.git "
1113
- " -o -path ./.svn "
1114
- " -o -path ./_darcs "
1115
- " -o -path ./.stack-work "
1116
- " -o -path ./dist "
1117
- " -o -path ./.cabal-sandbox "
1118
- " \\ ) -prune "
1119
- " -o -type f \\ ( "
1120
- " -name '*.hs' "
1121
- " -or -name '*.lhs' "
1122
- " -or -name '*.hsc' "
1123
- " \\ ) -not \\ ( "
1124
- " -name '#*' "
1125
- " -or -name '.*' "
1126
- " \\ ) -print0" )
1127
- " xargs -0 hasktags -e -x" )))))
1098
+ cabal-install, stack, etc and passes list of found files to Hasktags."
1099
+ (if (eq system-type 'windows-nt )
1100
+ (format " hasktags --output=\" %s \\ TAGS\" -x -e \" %s \" " dir dir)
1101
+ (format " cd %s && %s | %s "
1102
+ dir
1103
+ (concat " find . "
1104
+ " -type d \\ ( "
1105
+ " -path ./.git "
1106
+ " -o -path ./.svn "
1107
+ " -o -path ./_darcs "
1108
+ " -o -path ./.stack-work "
1109
+ " -o -path ./dist "
1110
+ " -o -path ./.cabal-sandbox "
1111
+ " \\ ) -prune "
1112
+ " -o -type f \\ ( "
1113
+ " -name '*.hs' "
1114
+ " -or -name '*.lhs' "
1115
+ " -or -name '*.hsc' "
1116
+ " \\ ) -not \\ ( "
1117
+ " -name '#*' "
1118
+ " -or -name '.*' "
1119
+ " \\ ) -print0" )
1120
+ " xargs -0 hasktags -e -x" )))
1128
1121
1129
1122
(provide 'haskell-cabal )
1130
1123
; ;; haskell-cabal.el ends here
0 commit comments