[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode f7f0e0f 383/385: moar extras
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode f7f0e0f 383/385: moar extras |
Date: |
Wed, 6 Oct 2021 00:00:09 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit f7f0e0fa98088a434f09564ee9fd2cc98e1f312d
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
moar extras
---
README.md | 2 ++
haskell-tng-extra-cabal-mode.el | 21 +++++++++++++++
haskell-tng-extra-hideshow.el | 39 +++++++++++++++++++++++++++
haskell-tng-extra.el | 59 ++++++++++++++++++++++-------------------
haskell-tng-hsinspect.el | 2 +-
haskell-tng-mode.el | 20 --------------
6 files changed, 95 insertions(+), 48 deletions(-)
diff --git a/README.md b/README.md
index 0acc1c7..acec808 100644
--- a/README.md
+++ b/README.md
@@ -48,10 +48,12 @@ A full installation may look like the following
(require 'haskell-tng-hsinspect)
(require 'haskell-tng-extra)
(require 'haskell-tng-extra-abbrev)
+ (require 'haskell-tng-extra-hideshow)
(require 'haskell-tng-extra-company)
(require 'haskell-tng-extra-projectile)
(require 'haskell-tng-extra-smartparens)
(require 'haskell-tng-extra-yasnippet)
+ ;; (require 'haskell-tng-extra-cabal-mode)
;; (require 'haskell-tng-extra-stack)
:bind
diff --git a/haskell-tng-extra-cabal-mode.el b/haskell-tng-extra-cabal-mode.el
new file mode 100644
index 0000000..c0724ab
--- /dev/null
+++ b/haskell-tng-extra-cabal-mode.el
@@ -0,0 +1,21 @@
+;;; haskell-tng-extra-cabal-mode.el --- a basic cabal-mode -*-
lexical-binding: t -*-
+
+;; Copyright (C) 2020 Tseen She
+;; License: GPL 3 or any later version
+
+;;; Commentary:
+;;
+;; A basic cabal-mode
+;;
+;;; Code:
+
+(define-derived-mode cabal-tng-mode fundamental-mode "Cabal"
+ "Major mode for editing Cabal configuration."
+ (setq-local compile-command (format "cabal-fmt -i %s" buffer-file-name)))
+
+(progn
+ (add-to-list 'auto-mode-alist `(,(rx ".cabal" eos) . cabal-tng-mode))
+ (modify-coding-system-alist 'file (rx ".cabal" eos) 'utf-8))
+
+(provide 'haskell-tng-extra-cabal-mode)
+;;; haskell-tng-extra-cabal-mode.el ends here
diff --git a/haskell-tng-extra-hideshow.el b/haskell-tng-extra-hideshow.el
new file mode 100644
index 0000000..a9615d0
--- /dev/null
+++ b/haskell-tng-extra-hideshow.el
@@ -0,0 +1,39 @@
+;;; haskell-tng-extra-hideshow.el --- hideshow-mode integration -*-
lexical-binding: t -*-
+
+;; Copyright (C) 2020 Tseen She
+;; License: GPL 3 or any later version
+
+;;; Commentary:
+;;
+;; Hide and show BOILERPLATE blocks.
+;;
+;;; Code:
+
+(require 'hideshow)
+(require 'haskell-tng-mode)
+
+(add-hook
+ 'haskell-tng-mode-hook
+ (lambda ()
+ (hs-minor-mode 1)
+ (setq-local hs-hide-comments-when-hiding-all nil)
+ (let ((inhibit-message t))
+ (hs-hide-all))))
+
+(add-to-list
+ 'hs-special-modes-alist
+ '(haskell-tng-mode
+ "{- BOILERPLATE START -}"
+ "{- BOILERPLATE END -}"
+ "-- "
+ haskell-tng--extra-hideshow-forward))
+
+(defun haskell-tng--extra-hideshow-forward (&optional _arg _interactive)
+ "hide-show forward function that does what you'd expect"
+ (goto-char
+ (save-excursion
+ (re-search-forward hs-block-end-regexp nil t)
+ (point))))
+
+(provide 'haskell-tng-extra-hideshow)
+;;; haskell-tng-extra-hideshow.el ends here
diff --git a/haskell-tng-extra.el b/haskell-tng-extra.el
index baa28bc..d648846 100644
--- a/haskell-tng-extra.el
+++ b/haskell-tng-extra.el
@@ -75,11 +75,12 @@ When in a comment and called with a prefix, the comment
will be completed."
(interactive)
(when (buffer-modified-p)
(save-buffer))
- (when (= 0 (call-process
- (haskell-tng--util-cached-variable
- (lambda () (haskell-tng--util-which "stylish-haskell"))
- 'haskell-tng-stylish-haskell)
- nil "*stylish-haskell*" nil "-i" buffer-file-name))
+ (if (/= 0 (call-process
+ (haskell-tng--util-cached-variable
+ (lambda () (haskell-tng--util-which "stylish-haskell"))
+ 'haskell-tng-stylish-haskell)
+ nil "*stylish-haskell*" nil "-i" buffer-file-name))
+ (user-error "stylish-haskell formatting failed")
(revert-buffer t t t)))
;;;###autoload
@@ -91,17 +92,18 @@ When in a comment and called with a prefix, the comment
will be completed."
(interactive)
(when (buffer-modified-p)
(save-buffer))
- (when (= 0 (call-process
- (haskell-tng--util-cached-variable
- (lambda () (haskell-tng--util-which "ormolu"))
- 'haskell-tng-ormolu)
- nil "*ormolu*" nil
- ;; "-p"
- "-o" "-XTypeApplications"
- "-o" "-XBangPatterns"
- "-o" "-XPatternSynonyms"
- "-m" "inplace"
- buffer-file-name))
+ (if (/= 0 (call-process
+ (haskell-tng--util-cached-variable
+ (lambda () (haskell-tng--util-which "ormolu"))
+ 'haskell-tng-ormolu)
+ nil "*ormolu*" nil
+ ;; "-p"
+ "-o" "-XTypeApplications"
+ "-o" "-XBangPatterns"
+ "-o" "-XPatternSynonyms"
+ "-m" "inplace"
+ buffer-file-name))
+ (user-error "ormolu formatting failed")
(revert-buffer t t t)))
;;;###autoload
@@ -112,10 +114,11 @@ When in a comment and called with a prefix, the comment
will be completed."
(interactive)
(when-let (default-directory
(locate-dominating-file default-directory "stack.yaml"))
- (call-process
- (haskell-tng--util-cached-variable
- (lambda () (haskell-tng--util-which "stack2cabal"))
- 'haskell-tng-stack2cabal))))
+ (when (/= 0 (call-process
+ (haskell-tng--util-cached-variable
+ (lambda () (haskell-tng--util-which "stack2cabal"))
+ 'haskell-tng-stack2cabal)))
+ (user-error "stack2cabal failed"))))
;;;###autoload
(defvar-local haskell-tng-boilerplate nil
@@ -125,13 +128,15 @@ When in a comment and called with a prefix, the comment
will be completed."
(interactive)
(when (buffer-modified-p)
(save-buffer))
- (when (= 0 (call-process
- (haskell-tng--util-cached-variable
- (lambda () (haskell-tng--util-which "boilerplate"))
- 'haskell-tng-boilerplate)
- nil "*boilerplate*" nil "-i" buffer-file-name))
+ (if (/= 0 (call-process
+ (haskell-tng--util-cached-variable
+ (lambda () (haskell-tng--util-which "boilerplate"))
+ 'haskell-tng-boilerplate)
+ nil "*boilerplate*" nil "-i" buffer-file-name))
+ (user-error "boilerplate generation failed")
(revert-buffer t t t)
- (hs-hide-all)))
+ (when hs-minor-mode
+ (hs-hide-all))))
;;;###autoload
(defun haskell-tng-goto-imports ()
@@ -169,7 +174,7 @@ When in a comment and called with a prefix, the comment
will be completed."
(reverse
(seq-take-while
(lambda (e) (let (case-fold-search)
- (string-match-p (rx bos upper) e)))
+ (string-match-p (rx bos upper) e)))
(reverse
(split-string
(file-name-sans-extension buffer-file-name)
diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index ac9f645..6f888e6 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -503,7 +503,7 @@ Does not persist the cache changes to disk."
"Finds and checks the hsinspect binary for the current buffer.
This is uncached, prefer `haskell-tng--hsinspect-exe'."
- (let ((supported '("0.0.7" "0.0.8" "0.0.9" "0.0.10" "0.0.11" "0.0.12"
"0.0.13" "0.0.14"))
+ (let ((supported '("0.0.7" "0.0.8" "0.0.9" "0.0.10" "0.0.11" "0.0.12"
"0.0.13" "0.0.14" "0.0.15"))
(bin (haskell-tng--util-ghcpath-which "hsinspect")))
(if bin
(let ((version
diff --git a/haskell-tng-mode.el b/haskell-tng-mode.el
index 60a584c..d53abfc 100644
--- a/haskell-tng-mode.el
+++ b/haskell-tng-mode.el
@@ -15,7 +15,6 @@
;;; Code:
(require 'dabbrev)
-(require 'hideshow)
(require 'imenu)
(require 'rx)
@@ -91,31 +90,12 @@ Load `prettify-symbols-mode' in `haskell-tng-mode-hook'."
(haskell-tng--smie-setup)
(prettify-symbols-mode 1)
- (hs-minor-mode 1)
-
- (setq-local hs-hide-comments-when-hiding-all nil)
- (unless noninteractive
- (let ((inhibit-message t))
- (hs-hide-all)))
)
;;;###autoload
(progn
(add-to-list 'auto-mode-alist `(,(rx ".hs" eos) . haskell-tng-mode))
- (add-to-list 'hs-special-modes-alist
- '(haskell-tng-mode
- "{- BOILERPLATE START -}"
- "{- BOILERPLATE END -}"
- "-- "
- haskell-tng--hs-forward))
(modify-coding-system-alist 'file (rx ".hs" eos) 'utf-8))
-(defun haskell-tng--hs-forward (&optional _arg _interactive)
- "hide-show forward function that does what you'd expect"
- (goto-char
- (save-excursion
- (re-search-forward hs-block-end-regexp nil t)
- (point))))
-
(provide 'haskell-tng-mode)
;;; haskell-tng-mode.el ends here
- [nongnu] elpa/haskell-tng-mode 1e3c465 329/385: import types and data constructors, (continued)
- [nongnu] elpa/haskell-tng-mode 1e3c465 329/385: import types and data constructors, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3ab7495 342/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ef3cea6 340/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a14a2c2 332/385: allow dir locals for the -as lookups, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2050c16 323/385: bad parameter order, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2d50a06 358/385: enable CI, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 923fa9e 344/385: bugfixes in jump-to-definition, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3939303 334/385: importing from the hsinspect index will update the buffer cache, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3ea52c1 341/385: special case jumping to inplace packages, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4217d98 378/385: fixup! third party tools use project specific PATH, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f7f0e0f 383/385: moar extras,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 2017d07 384/385: widen hsinspect range, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 083e80a 110/385: assert on alternative indentation order, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ec1ac46 361/385: document a bug, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4b598b2 377/385: third party tools use project specific PATH, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode aaf7c55 370/385: support for hsinspect-lsp, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b3e6c9a 113/385: compilation mode regression tests vs haskell-mode, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 99a7f10 337/385: cleanup, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e6d8761 343/385: local jump-to-definition should error, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c31afdb 272/385: missing CPP case, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 85c4dd5 233/385: fix bugfix in goto-import, ELPA Syncer, 2021/10/06