[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode fd06b8f 264/385: move haskell-tng-newline
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode fd06b8f 264/385: move haskell-tng-newline into the -extra package |
Date: |
Tue, 5 Oct 2021 23:59:44 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit fd06b8fbd5dc39e92d8f91a764bad291e39063b0
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
move haskell-tng-newline into the -extra package
---
haskell-tng-extra.el | 34 ++++++++++++++++++++++++++++++++++
haskell-tng-smie.el | 33 ---------------------------------
2 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/haskell-tng-extra.el b/haskell-tng-extra.el
index 7834dff..912bf69 100644
--- a/haskell-tng-extra.el
+++ b/haskell-tng-extra.el
@@ -19,6 +19,40 @@
(require 'subr-x)
+;;###autoload
+(defun haskell-tng-newline (&optional alt)
+ "A `newline-and-indent' with a better user experience for `haskell-tng-mode'.
+
+When in a comment and called with a prefix, the comment will be completed."
+ (interactive "P")
+ ;; TODO a dynamically bound variable might improve the quality of
+ ;; 'empty-line-token predictions. Parens are special-cased.
+ (when (<= (- (point-max) 1) (point))
+ ;; WORKAROUND https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36432
+ ;; TODO fix the bug properly in SMIE
+ (save-excursion (insert "\n\n")))
+ (let ((rem (save-excursion
+ (skip-syntax-forward " ")
+ (unless (looking-at (rx (syntax close-parenthesis)))
+ (when (/= (point) (line-end-position))
+ (buffer-substring-no-properties (point)
(line-end-position)))))))
+ (when rem
+ (delete-region (point) (line-end-position)))
+ ;; TODO don't continue line comments if there is code before them
+ ;;
+ ;; TODO in-comment indent should observer but not repeat | haddock markers
+ (cond
+ (alt
+ (call-interactively #'newline-and-indent))
+ ((looking-back (rx (>= 3 "-")) (line-beginning-position))
+ ;; don't continue or indent visual line breaks
+ (call-interactively #'newline))
+ (t
+ (call-interactively #'comment-indent-new-line)))
+ (when rem
+ (save-excursion
+ (insert rem)))))
+
;;;###autoload
(defun haskell-tng-stylish-haskell ()
"Apply `stylish-haskell' rules."
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 2348d07..df2badb 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -31,39 +31,6 @@
(require 'haskell-tng-font-lock)
(require 'haskell-tng-lexer)
-(defun haskell-tng-newline (&optional alt)
- "A `newline-and-indent' with a better user experience for `haskell-tng-mode'.
-
-When in a comment and called with a prefix, the comment will be completed."
- (interactive "P")
- ;; TODO a dynamically bound variable might improve the quality of
- ;; 'empty-line-token predictions. Parens are special-cased.
- (when (<= (- (point-max) 1) (point))
- ;; WORKAROUND https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36432
- ;; TODO fix the bug properly in SMIE
- (save-excursion (insert "\n\n")))
- (let ((rem (save-excursion
- (skip-syntax-forward " ")
- (unless (looking-at (rx (syntax close-parenthesis)))
- (when (/= (point) (line-end-position))
- (buffer-substring-no-properties (point)
(line-end-position)))))))
- (when rem
- (delete-region (point) (line-end-position)))
- ;; TODO don't continue line comments if there is code before them
- ;;
- ;; TODO in-comment indent should observer but not repeat | haddock markers
- (cond
- (alt
- (call-interactively #'newline-and-indent))
- ((looking-back (rx (>= 3 "-")) (line-beginning-position))
- ;; don't continue or indent visual line breaks
- (call-interactively #'newline))
- (t
- (call-interactively #'comment-indent-new-line)))
- (when rem
- (save-excursion
- (insert rem)))))
-
;; TODO autodetection of indent options
(defcustom haskell-tng-aligntypes nil
- [nongnu] elpa/haskell-tng-mode aaf7c55 370/385: support for hsinspect-lsp, (continued)
- [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
- [nongnu] elpa/haskell-tng-mode 5c157fb 255/385: rigid ormolu support, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 64ec84d 260/385: if/then/else indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1d53572 243/385: bugfixes, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d1e599a 285/385: switch formatting backend based on project config, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fd06b8f 264/385: move haskell-tng-newline into the -extra package,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 8ff79e7 247/385: allow parallelism, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4e2cf00 284/385: simplify the installation of hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1107e63 274/385: bump hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8475578 311/385: typos, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f8d2b91 295/385: miss some false positive ghc errors, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fca5c6e 315/385: better docs and cabal-install support, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b2e19c9 318/385: document next steps, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c39d0f4 321/385: some hsinspect tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5fe4cb1 359/385: cleanup test includes, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 38ed1b7 326/385: import types, ELPA Syncer, 2021/10/06