emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-tng-mode 3ff278e 227/385: ability to not continue


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode 3ff278e 227/385: ability to not continue comments
Date: Tue, 5 Oct 2021 23:59:36 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit 3ff278ed63e929a379802e12274ff93ce4d5268e
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>

    ability to not continue comments
---
 haskell-tng-smie.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 898f015..84f13c9 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -31,9 +31,11 @@
 (require 'haskell-tng-font-lock)
 (require 'haskell-tng-lexer)
 
-(defun haskell-tng-newline ()
-  "A `newline-and-indent' with a better user experience for 
`haskell-tng-mode'."
-  (interactive)
+(defun haskell-tng-newline (&optional alt)
+  "A `newline-and-indent' with a better user experience for `haskell-tng-mode'.
+
+Comments are continued unless called with a prefix."
+  (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))
@@ -50,7 +52,9 @@
     ;; TODO don't continue line comments if there is code before them
     ;;
     ;; TODO in-comment indent should observe | haddock markers
-    (call-interactively #'comment-indent-new-line)
+    (if alt
+        (call-interactively #'newline-and-indent)
+      (call-interactively #'comment-indent-new-line))
     (when rem
       (save-excursion
         (insert rem)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]