branch: elpa/haskell-tng-mode commit 6a31b591a28f3c62b1f6412dcb7add22fa408fd3 Author: Tseen She <ts33n....@gmail.com> Commit: Tseen She <ts33n....@gmail.com>
document the plan for indentation --- haskell-tng-smie.el | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el index 5a887c7..df284b0 100644 --- a/haskell-tng-smie.el +++ b/haskell-tng-smie.el @@ -107,13 +107,36 @@ (defun haskell-tng-smie:indent-cycle () "Returns the next alternative indentation level from a ring." (when (and - (not (eq this-command #'newline-and-indent)) - (eq this-command last-command)) - ;; TODO invalidate the cycle + (eq this-command last-command) + ;; TODO allow users to define the blacklist, incase they have a custom + ;; newline+tab command. + (not (eq this-command #'newline-and-indent))) + ;; TODO invalidation of any caches + ;; TODO record the smie indent level (recursing like in stefan's code) ;; TODO implement ;; (message "CALLING INDENT CYCLE FROM %s" this-command) 2)) +;; (defun haskell-tng:smie-indent () +;; (cond +;; ;; When we're not in the top-level call to smie-indent-calculate, so just do +;; ;; nothing and let the other rules do their job. +;; (haskell-tng:smie-indent-nested-call nil) +;; ;; When cycling, return the next indentation. +;; ((eq this-command last-command) +;; (haskell-tng:return-next-stashed-indentation-column)) +;; ;; When we're in the top-level call to smie-indent-calculate, take control +;; ;; and return a non-nil value to prevent the other rules from being used. +;; (t +;; (let ((haskell-tng:smie-indent-nested-call t) +;; (n (haskell-tng:get-number-of-closing-braces-at-bol)) +;; (indentations ())) +;; (dotimes (i n) +;; (haskell-tng:tell-lexer-there-are-N-closing-braces-at-bol i) +;; (push (smie-indent-calculate) indentations)) +;; (haskell-tng:stash-indentation-columns indentations) +;; (haskell-tng:return-next-stashed-indentation-column))))) + (defun haskell-tng-smie:setup () (setq-local smie-indent-basic 2)