Function: haskell-literate-mode

haskell-literate-mode is an interactive and natively compiled function defined in haskell-mode.el.

Signature

(haskell-literate-mode)

Documentation

As haskell-mode but for literate scripts.

In addition to any hooks its parent mode might have run, this mode runs the hook haskell-literate-mode-hook, as the final or penultimate step during initialization.

Key Bindings

This command is not in any keymaps.

Aliases

literate-haskell-mode (obsolete since 2020-04)

Source Code

;; Defined in /nix/store/9lz2mhw95f9fqxr9mnq46k3f6qz3aq83-emacs-packages-deps/share/emacs/site-lisp/elpa/haskell-mode-20260904.1042/haskell-mode.el
;;;###autoload
(define-derived-mode haskell-literate-mode haskell-mode "LitHaskell"
  "As `haskell-mode' but for literate scripts."
  (setq haskell-literate
        (save-excursion
          (goto-char (point-min))
          (cond
           ((re-search-forward "^\\\\\\(begin\\|end\\){code}$" nil t) 'tex)
           ((re-search-forward "^>" nil t) 'bird)
           (t haskell-literate-default))))
  (if (eq haskell-literate 'bird)
      ;; fill-comment-paragraph isn't much use there, and even gets confused
      ;; by the syntax-table text-properties we add to mark the first char
      ;; of each line as a comment-starter.
      (setq-local fill-paragraph-handle-comment nil))
  (setq-local mode-line-process '("/" (:eval (symbol-name haskell-literate)))))