From 6e425db699dd1f49d74899e1d4e024a5913c0cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Sun, 13 Mar 2016 23:44:10 +0500 Subject: [PATCH 01/13] Define hasktags command composer --- haskell-cabal.el | 51 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/haskell-cabal.el b/haskell-cabal.el index f7a214c6b..bc5a1fa10 100644 --- a/haskell-cabal.el +++ b/haskell-cabal.el @@ -1069,6 +1069,55 @@ source-section." ;; unwind (haskell-mode-toggle-interactive-prompt-state t))) -(provide 'haskell-cabal) +(defun haskell-cabal--compose-hasktags-command (&optional cabal-dir) + "Prepare command to execute hasktags for current file. +By default following parameters are passed to Hasktags +executable: +-e - generate ETAGS file +-x - generate additional information in CTAGS file. + +Tries to find cabal file location, give optional CABAL-DIR +parameter to override it. If cabal file not found uses current +file directory. + +This function takes into account user's operation system: in case +of Windows it generates simple command like + +hasktags --output=DIR\TAGS -x -e DIR + +relying on Hasktags itself to find source files; + +In other cases it uses `find` command to find all source files +recursively avoiding visiting unnecessary heavy directories like +.git, .svn, _darcs and build directories created by +cabal-install, stack, etc." + (let ((dir (or cabal-dir + (haskell-cabal-find-dir) + (file-name-directory buffer-file-name)))) + (when dir + (if (eq system-type 'windows-nt) + (format "hasktags --output=\"%s\\TAGS\" -x -e \"%s\"" dir dir) + (format "cd %s && %s | %s" + dir + (concat "find . " + "-type d \\( " + "-path ./.git " + "-o -path ./.svn " + "-o -path ./_darcs " + "-o -path ./.stack-work " + "-o -path ./dist " + "-o -path ./.cabal-sandbox " + "\\) -prune " + "-o -type f \\( " + "-name '*.hs' " + "-or -name '*.lhs' " + "-or -name '*.hsc' " + "\\) -not \\( " + "-name '#*' " + "-or -name '.*' " + "\\) -print0") + "xargs -0 hasktags -e -x"))))) + +(provide 'haskell-cabal) ;;; haskell-cabal.el ends here From 1018f6a6fe78f478521fd6ae0794f7b9e7d33e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Sun, 13 Mar 2016 23:45:06 +0500 Subject: [PATCH 02/13] Use hasktags command composer --- haskell-commands.el | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/haskell-commands.el b/haskell-commands.el index 1e9e9534f..aff8ff099 100644 --- a/haskell-commands.el +++ b/haskell-commands.el @@ -35,6 +35,7 @@ (require 'haskell-presentation-mode) (require 'haskell-utils) (require 'highlight-uses-mode) +(require 'haskell-cabal) ;;;###autoload (defun haskell-process-restart () @@ -700,20 +701,13 @@ function `xref-find-definitions' after new table was generated." process (make-haskell-command :state (cons process and-then-find-this-tag) - :go (lambda (state) - (if (eq system-type 'windows-nt) - (haskell-process-send-string - (car state) - (format ":!hasktags --output=\"%s\\TAGS\" -x -e \"%s\"" - (haskell-session-cabal-dir (haskell-process-session (car state))) - (haskell-session-cabal-dir (haskell-process-session (car state))))) - (haskell-process-send-string - (car state) - (format ":!cd %s && %s | %s" - (haskell-session-cabal-dir - (haskell-process-session (car state))) - "find . -type d \\( -path ./.stack-work -o -path ./dist -o -path ./.cabal-sandbox \\) -prune -o -type f \\( -name '*.hs' -or -name '*.lhs' -or -name '*.hsc' \\) -not \\( -name '#*' -or -name '.*' \\) -print0" - "xargs -0 hasktags -e -x")))) + :go + (lambda (state) + (let* ((process (car state)) + (cabal-dir (haskell-session-cabal-dir + (haskell-process-session process))) + (command (haskell-cabal--compose-hasktags-command cabal-dir))) + (haskell-process-send-string process command))) :complete (lambda (state _response) (when (cdr state) (let ((tags-file-name From 31eac18f7201fddce148bba3b036103c97260ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Sun, 13 Mar 2016 23:45:39 +0500 Subject: [PATCH 03/13] Implement tags generation in static mode --- haskell-mode.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/haskell-mode.el b/haskell-mode.el index 8e927c65e..acae1d3ee 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -144,6 +144,7 @@ (require 'haskell-string) (require 'haskell-indentation) (require 'haskell-font-lock) +(require 'haskell-cabal) ;; All functions/variables start with `(literate-)haskell-'. @@ -1069,8 +1070,13 @@ successful, nil otherwise." (goto-char (point-min)) (end-of-line))) -;; Provide ourselves: +(defun haskell-mode-generate-tags () + "Generate tags using Hasktags. This is synchronous function." + (let ((command (haskell-cabal--compose-hasktags-command))) + (if command + (shell-command command) + (error "Unable to compose hasktags command")))) +;; Provide ourselves: (provide 'haskell-mode) - ;;; haskell-mode.el ends here From 60f19f623b2b56ef2edc9ea08e3c2880cdf42482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Sun, 13 Mar 2016 23:46:26 +0500 Subject: [PATCH 04/13] Generate tags conditionally If session is present then use asynchrounous tags generation function from interactive package, otherwise use blocking function from static package. --- haskell.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/haskell.el b/haskell.el index 9f20cdd96..6964fc2bf 100644 --- a/haskell.el +++ b/haskell.el @@ -354,8 +354,11 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." (defun haskell-mode-after-save-handler () "Function that will be called after buffer's saving." (when haskell-tags-on-save - (ignore-errors (when (and (boundp 'haskell-session) haskell-session) - (haskell-process-generate-tags)))) + (ignore-errors + (if (and (boundp 'haskell-session) + haskell-session) + (haskell-process-generate-tags) + (haskell-mode-generate-tags)))) (when haskell-stylish-on-save (ignore-errors (haskell-mode-stylish-buffer)) (let ((before-save-hook '()) From 55b6173cf5e9530917c283b5f68ce7b83f766b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Mon, 14 Mar 2016 01:50:17 +0500 Subject: [PATCH 05/13] Define a function to search suitable directory for TAGS Traversing directories is potentially very costful action. This function helps to re-use found dir in some cases. --- haskell-cabal.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/haskell-cabal.el b/haskell-cabal.el index bc5a1fa10..b7df573d1 100644 --- a/haskell-cabal.el +++ b/haskell-cabal.el @@ -1070,6 +1070,15 @@ source-section." (haskell-mode-toggle-interactive-prompt-state t))) +(defun haskell-cabal--find-tags-dir () + "Return a directory where TAGS file will be generated. +Tries to find cabal file first and if succeeds uses its location. +If cabal file not found uses current file directory. If current +buffer not visiting a file returns nil." + (or (haskell-cabal-find-dir) + (when buffer-file-name + (file-name-directory buffer-file-name)))) + (defun haskell-cabal--compose-hasktags-command (&optional cabal-dir) "Prepare command to execute hasktags for current file. By default following parameters are passed to Hasktags From d657c6b7174927f5b802a0b5c0c5625e2af393be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Mon, 14 Mar 2016 01:52:20 +0500 Subject: [PATCH 06/13] Use haskell-cabal--find-tags-dir --- haskell-cabal.el | 10 ++++------ haskell-mode.el | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/haskell-cabal.el b/haskell-cabal.el index b7df573d1..f45bbefc9 100644 --- a/haskell-cabal.el +++ b/haskell-cabal.el @@ -1086,9 +1086,9 @@ executable: -e - generate ETAGS file -x - generate additional information in CTAGS file. -Tries to find cabal file location, give optional CABAL-DIR -parameter to override it. If cabal file not found uses current -file directory. +Tries to find cabal file location, give optional CABAL-DIR parameter to +override it. If cabal file not found uses current file +directory if current buffer is visiting a file. Otherwise returns nil. This function takes into account user's operation system: in case of Windows it generates simple command like @@ -1101,9 +1101,7 @@ In other cases it uses `find` command to find all source files recursively avoiding visiting unnecessary heavy directories like .git, .svn, _darcs and build directories created by cabal-install, stack, etc." - (let ((dir (or cabal-dir - (haskell-cabal-find-dir) - (file-name-directory buffer-file-name)))) + (let ((dir (or cabal-dir (haskell-cabal--find-tags-dir)))) (when dir (if (eq system-type 'windows-nt) (format "hasktags --output=\"%s\\TAGS\" -x -e \"%s\"" dir dir) diff --git a/haskell-mode.el b/haskell-mode.el index acae1d3ee..d455c911d 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -1072,7 +1072,8 @@ successful, nil otherwise." (defun haskell-mode-generate-tags () "Generate tags using Hasktags. This is synchronous function." - (let ((command (haskell-cabal--compose-hasktags-command))) + (let* ((dir (haskell-cabal--find-tags-dir)) + (command (haskell-cabal--compose-hasktags-command dir))) (if command (shell-command command) (error "Unable to compose hasktags command")))) From 6b229b717d331b6378434687ba83a6ddaf178f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Mon, 14 Mar 2016 01:53:27 +0500 Subject: [PATCH 07/13] Move messaging functions to haskell-mode.el Move `haskell-mode-message-line` and `haskell-mode-one-line` to haskell-mode.el. This function are not specific to interactive package, also both have name which nicely fit to haskell-mode.el rather than haskell-interactive-mode.el. This movement is required to for static tags generation function also. --- haskell-interactive-mode.el | 12 ------------ haskell-load.el | 1 + haskell-mode.el | 12 ++++++++++++ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/haskell-interactive-mode.el b/haskell-interactive-mode.el index 98037843a..34f01e072 100644 --- a/haskell-interactive-mode.el +++ b/haskell-interactive-mode.el @@ -425,18 +425,6 @@ SESSION, otherwise operate on the current buffer." (setq haskell-interactive-mode-history-index 0)) -(defun haskell-mode-message-line (str) - "Message only one line, multiple lines just disturbs the programmer." - (message (haskell-mode-one-line str (frame-width)))) - -(defun haskell-mode-one-line (str width) - "Try to fit as much as possible on one line." - (let* - ((long-line (replace-regexp-in-string "\n" " " str)) - (condensed (replace-regexp-in-string " +" " " - (haskell-string-trim long-line)))) - (truncate-string-to-width condensed width nil nil "…"))) - (defun haskell-interactive-mode-tab () "Do completion if at prompt or else try collapse/expand." (interactive) diff --git a/haskell-load.el b/haskell-load.el index fc3a14bcf..3dd70c506 100644 --- a/haskell-load.el +++ b/haskell-load.el @@ -21,6 +21,7 @@ ;;; Code: (require 'cl-lib) +(require 'haskell-mode) (require 'haskell-process) (require 'haskell-interactive-mode) (require 'haskell-modules) diff --git a/haskell-mode.el b/haskell-mode.el index d455c911d..2e7c89b4e 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -1077,6 +1077,18 @@ successful, nil otherwise." (if command (shell-command command) (error "Unable to compose hasktags command")))) +(defun haskell-mode-message-line (str) + "Echo STR in mini-buffer. +Given string is shrinken to single line, multiple lines just +disturbs the programmer." + (message (haskell-mode-one-line str (frame-width)))) + +(defun haskell-mode-one-line (str width) + "Try to fit STR as much as possible on one line according to given WIDTH." + (let* ((long-line (replace-regexp-in-string "\n" " " str)) + (condensed (replace-regexp-in-string + " +" " " (haskell-string-trim long-line)))) + (truncate-string-to-width condensed width nil nil "…"))) ;; Provide ourselves: (provide 'haskell-mode) From 7143772cea07599022bfdbefe87030e4bce555af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Mon, 14 Mar 2016 01:59:46 +0500 Subject: [PATCH 08/13] Follow interactive tags generation function behaviour Support optional parameter to jump to indentifier definition after tags were generated. --- haskell-mode.el | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/haskell-mode.el b/haskell-mode.el index 2e7c89b4e..b8bcc7fdc 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -1070,13 +1070,22 @@ successful, nil otherwise." (goto-char (point-min)) (end-of-line))) -(defun haskell-mode-generate-tags () - "Generate tags using Hasktags. This is synchronous function." +(defun haskell-mode-generate-tags (&optional and-then-find-this-tag) + "Generate tags using Hasktags. This is synchronous function. + +If optional AND-THEN-FIND-THIS-TAG argument is present it is used +with function `xref-find-definitions' after new table was +generated." (let* ((dir (haskell-cabal--find-tags-dir)) (command (haskell-cabal--compose-hasktags-command dir))) - (if command - (shell-command command) - (error "Unable to compose hasktags command")))) + (if (not command) + (error "Unable to compose hasktags command") + (shell-command command) + (haskell-mode-message-line "Tags generated.") + (when and-then-find-this-tag + (let ((tags-file-name dir)) + (xref-find-definitions and-then-find-this-tag)))))) + (defun haskell-mode-message-line (str) "Echo STR in mini-buffer. Given string is shrinken to single line, multiple lines just From 54d6b3b01a72ff93d3e858d73f68a3d4162777d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Mon, 14 Mar 2016 02:12:51 +0500 Subject: [PATCH 09/13] Switch to static tags generation in jump-to-tag and on save --- haskell-mode.el | 1 + haskell.el | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/haskell-mode.el b/haskell-mode.el index b8bcc7fdc..924f8fe42 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -1070,6 +1070,7 @@ successful, nil otherwise." (goto-char (point-min)) (end-of-line))) +;;;###autoload (defun haskell-mode-generate-tags (&optional and-then-find-this-tag) "Generate tags using Hasktags. This is synchronous function. diff --git a/haskell.el b/haskell.el index 6964fc2bf..1db45123d 100644 --- a/haskell.el +++ b/haskell.el @@ -342,23 +342,21 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." "Jump to the tag of the given identifier." (interactive "P") (let ((ident (haskell-ident-at-point)) - (tags-file-name (haskell-session-tags-filename (haskell-session))) + (tags-file-dir (haskell-cabal--find-tags-dir)) (tags-revert-without-query t)) - (when (and ident (not (string= "" (haskell-string-trim ident)))) - (cond ((file-exists-p tags-file-name) - (let ((xref-prompt-for-identifier next-p)) - (xref-find-definitions ident))) - (t (haskell-process-generate-tags ident)))))) + (when (and ident + (not (string= "" (haskell-string-trim ident))) + tags-file-dir) + (let ((tags-file-name (concat tags-file-dir "TAGS"))) + (cond ((file-exists-p tags-file-name) + (let ((xref-prompt-for-identifier next-p)) + (xref-find-definitions ident))) + (t (haskell-mode-generate-tags ident))))))) ;;;###autoload (defun haskell-mode-after-save-handler () "Function that will be called after buffer's saving." - (when haskell-tags-on-save - (ignore-errors - (if (and (boundp 'haskell-session) - haskell-session) - (haskell-process-generate-tags) - (haskell-mode-generate-tags)))) + (when haskell-tags-on-save (ignore-errors (haskell-mode-generate-tags))) (when haskell-stylish-on-save (ignore-errors (haskell-mode-stylish-buffer)) (let ((before-save-hook '()) From 759bf5de2787f00d3f292e75757b9b7ec8e7de4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Mon, 14 Mar 2016 02:14:01 +0500 Subject: [PATCH 10/13] Deprecate interactive tags generation function --- haskell-commands.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/haskell-commands.el b/haskell-commands.el index aff8ff099..a5bdf0c2f 100644 --- a/haskell-commands.el +++ b/haskell-commands.el @@ -690,7 +690,9 @@ happened since function invocation)." (haskell-utils-async-stop-watching-changes init-buffer)))))))) -;;;###autoload +(make-obsolete #'haskell-process-generate-tags + #'haskell-mode-generate-tags + "2016-03-14") (defun haskell-process-generate-tags (&optional and-then-find-this-tag) "Regenerate the TAGS table. If optional AND-THEN-FIND-THIS-TAG argument is present it is used with From c358be5e23c1f993a005f42defc026fe42eeaffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Mon, 14 Mar 2016 02:14:20 +0500 Subject: [PATCH 11/13] Fix docs --- haskell.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/haskell.el b/haskell.el index 1db45123d..a3dc618b2 100644 --- a/haskell.el +++ b/haskell.el @@ -339,7 +339,10 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." ;;;###autoload (defun haskell-mode-jump-to-tag (&optional next-p) - "Jump to the tag of the given identifier." + "Jump to the tag of the given identifier. + +Give optional NEXT-P parameter to override value of +`xref-prompt-for-identifier' during definition search." (interactive "P") (let ((ident (haskell-ident-at-point)) (tags-file-dir (haskell-cabal--find-tags-dir)) From c0b157ddbf4382a21faa89eceb6724552558156d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Mon, 21 Mar 2016 18:44:01 +0500 Subject: [PATCH 12/13] Make directory argument mandatory in hasktags command composer --- haskell-cabal.el | 61 +++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/haskell-cabal.el b/haskell-cabal.el index f45bbefc9..f8dd89968 100644 --- a/haskell-cabal.el +++ b/haskell-cabal.el @@ -1079,52 +1079,45 @@ buffer not visiting a file returns nil." (when buffer-file-name (file-name-directory buffer-file-name)))) -(defun haskell-cabal--compose-hasktags-command (&optional cabal-dir) - "Prepare command to execute hasktags for current file. +(defun haskell-cabal--compose-hasktags-command (dir) + "Prepare command to execute `hasktags` command in DIR folder. By default following parameters are passed to Hasktags executable: -e - generate ETAGS file -x - generate additional information in CTAGS file. -Tries to find cabal file location, give optional CABAL-DIR parameter to -override it. If cabal file not found uses current file -directory if current buffer is visiting a file. Otherwise returns nil. - This function takes into account user's operation system: in case -of Windows it generates simple command like +of Windows it generates simple command, relying on Hasktags +itself to find source files: hasktags --output=DIR\TAGS -x -e DIR -relying on Hasktags itself to find source files; - In other cases it uses `find` command to find all source files recursively avoiding visiting unnecessary heavy directories like .git, .svn, _darcs and build directories created by -cabal-install, stack, etc." - (let ((dir (or cabal-dir (haskell-cabal--find-tags-dir)))) - (when dir - (if (eq system-type 'windows-nt) - (format "hasktags --output=\"%s\\TAGS\" -x -e \"%s\"" dir dir) - (format "cd %s && %s | %s" - dir - (concat "find . " - "-type d \\( " - "-path ./.git " - "-o -path ./.svn " - "-o -path ./_darcs " - "-o -path ./.stack-work " - "-o -path ./dist " - "-o -path ./.cabal-sandbox " - "\\) -prune " - "-o -type f \\( " - "-name '*.hs' " - "-or -name '*.lhs' " - "-or -name '*.hsc' " - "\\) -not \\( " - "-name '#*' " - "-or -name '.*' " - "\\) -print0") - "xargs -0 hasktags -e -x"))))) +cabal-install, stack, etc and passes list of found files to Hasktags." + (if (eq system-type 'windows-nt) + (format "hasktags --output=\"%s\\TAGS\" -x -e \"%s\"" dir dir) + (format "cd %s && %s | %s" + dir + (concat "find . " + "-type d \\( " + "-path ./.git " + "-o -path ./.svn " + "-o -path ./_darcs " + "-o -path ./.stack-work " + "-o -path ./dist " + "-o -path ./.cabal-sandbox " + "\\) -prune " + "-o -type f \\( " + "-name '*.hs' " + "-or -name '*.lhs' " + "-or -name '*.hsc' " + "\\) -not \\( " + "-name '#*' " + "-or -name '.*' " + "\\) -print0") + "xargs -0 hasktags -e -x"))) (provide 'haskell-cabal) ;;; haskell-cabal.el ends here From 9d170072a1e056a05c72fbe84bc3a47773f4a946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Fayzrakhmanov=20=28=D0=90=D1=80=D1=82=D1=83=D1=80?= =?UTF-8?q?=20=D0=A4=D0=B0=D0=B9=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=29?= Date: Mon, 21 Mar 2016 21:35:14 +0500 Subject: [PATCH 13/13] Remove unnecessary hashes --- haskell-commands.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haskell-commands.el b/haskell-commands.el index a5bdf0c2f..9ce5733ca 100644 --- a/haskell-commands.el +++ b/haskell-commands.el @@ -690,8 +690,8 @@ happened since function invocation)." (haskell-utils-async-stop-watching-changes init-buffer)))))))) -(make-obsolete #'haskell-process-generate-tags - #'haskell-mode-generate-tags +(make-obsolete 'haskell-process-generate-tags + 'haskell-mode-generate-tags "2016-03-14") (defun haskell-process-generate-tags (&optional and-then-find-this-tag) "Regenerate the TAGS table.