Function: haskell-indentation-indent-backwards
haskell-indentation-indent-backwards is an interactive and natively
compiled function defined in haskell-indentation.el.
Signature
(haskell-indentation-indent-backwards)
Documentation
Indent the current line to the previous indentation point.
Key Bindings
haskell-indentation-mode-map <backtab>
Source Code
;; Defined in /nix/store/9lz2mhw95f9fqxr9mnq46k3f6qz3aq83-emacs-packages-deps/share/emacs/site-lisp/elpa/haskell-mode-20260904.1042/haskell-indentation.el
(defun haskell-indentation-indent-backwards ()
"Indent the current line to the previous indentation point."
(interactive "*")
(cond
((and (memq last-command
'(indent-for-tab-command haskell-indentation-indent-backwards))
(eq haskell-indentation-dyn-last-direction 'region))
(let ((mark-even-if-inactive t))
(haskell-indentation-indent-rigidly (region-beginning) (region-end) -1)))
((use-region-p)
(setq haskell-indentation-dyn-last-direction 'region)
(haskell-indentation-indent-rigidly (region-beginning) (region-end) -1)
(message "Press TAB or S-TAB again to indent the region more"))
(t
(setq haskell-indentation-dyn-last-direction nil)
(let* ((cc (current-column))
(ci (haskell-indentation-current-indentation))
(inds (save-excursion
(move-to-column ci)
(or (haskell-indentation-find-indentations)
'(0))))
(cursor-in-whitespace (< cc ci))
(pi (haskell-indentation-previous-indentation ci inds)))
(if (null pi)
;; if there are no more indentations to the left, just go to column 0
(haskell-indentation-reindent-to
(car (haskell-indentation-first-indentation)) cursor-in-whitespace)
(haskell-indentation-reindent-to pi cursor-in-whitespace))))))