[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode b1c664b 364/385: allow hsinspect populati
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode b1c664b 364/385: allow hsinspect population in the background |
Date: |
Wed, 6 Oct 2021 00:00:05 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit b1c664bafaef9ffd8ac880e1e9ebdb9524ed9cc2
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
allow hsinspect population in the background
---
haskell-tng-hsinspect.el | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index 7b26983..fb4c705 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -20,6 +20,7 @@
(require 'array)
(require 'subr-x)
(require 'tar-mode)
+(require 'timer)
(require 'url)
;; Popups are not supported in stock Emacs so an extension is necessary:
@@ -71,6 +72,10 @@ definition of the symbol in the build tool's source archive."
;; unexported modules for inplace packages. It's starting to
;; sound like a very complex feature... and perhaps not worth
;; implementing given that TAGS work just great.
+ ;;
+ ;; FIXME or implement this by constructing the expected path/filename
+ ;; from the module name and then just find files having that
name
+ ;; and pick the first one. Should work 99% of the time.
(error "%s is defined in a local package" qualified)
(when-let* ((srcid (or internal-srcid (alist-get 'srcid pkg-entry)))
(module (or internal-module (alist-get 'module
module-entry)))
@@ -531,5 +536,26 @@ This is uncached, prefer `haskell-tng--hsinspect-exe'."
(haskell-tng--hsinspect-imports nil alt)
(haskell-tng--hsinspect-index alt))
+(defcustom haskell-tng-hsinspect-auto -1
+ "Automatically run `hsinspect'.
+
+Runs after the given number of idle seconds, ignoring errors.
+Negative to disable."
+ :type 'integerp
+ :group 'haskell-tng)
+
+(defun haskell-tng-hsinspect-hook ()
+ (when (<= 0 haskell-tng-hsinspect-auto)
+ (run-with-idle-timer
+ haskell-tng-hsinspect-auto
+ nil
+ (lambda ()
+ (message "Running hsinspect in the background")
+ (make-thread #'haskell-tng-hsinspect)))))
+
+(add-hook
+ 'haskell-tng-mode-hook
+ #'haskell-tng-hsinspect-hook)
+
(provide 'haskell-tng-hsinspect)
;;; haskell-tng-hsinspect.el ends here
- [nongnu] elpa/haskell-tng-mode b2e2c3a 293/385: stop stack from being an asshole, (continued)
- [nongnu] elpa/haskell-tng-mode b2e2c3a 293/385: stop stack from being an asshole, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ee07f6d 172/385: type indentation tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 59354b6 198/385: support hanging type alignment, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a788ab2 209/385: more efficient layout caching, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f7e8040 213/385: = ends a type sig, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fe9d65d 222/385: helper for yatemplates, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode bc93c3d 224/385: very alpha hsinspect support, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 658ddb6 251/385: docs, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 73a60f5 309/385: cache `which hsinspect` per project, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5707166 365/385: use new ghcflags-provided PATH, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b1c664b 364/385: allow hsinspect population in the background,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode ce17d96 376/385: new hsinspect release, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode eb6b487 357/385: test fqn-at-point and fix a longstanding bug, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 103e758 325/385: expose some more hsinspect-0.0.8 index info, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 374835c 355/385: a test for interactive commands, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e3c6dc6 336/385: follow re-exports, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9904e72 366/385: jump-to-definition works inside the project, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1c68e79 381/385: requires emacs 27, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 55d8e69 385/385: upgrade hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 97e4a66 379/385: bump hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3870bf1 367/385: time to remove the cabal v2- prefixes, ELPA Syncer, 2021/10/06