Variable: haskell-mode-abbrev-table
haskell-mode-abbrev-table is a variable defined in haskell-mode.el.
Value
#<obarray n=1>
Documentation
Abbrev table for haskell-mode.
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-mode prog-mode "Haskell"
"Major mode for editing Haskell programs.
\\<haskell-mode-map>
Literate Haskell scripts are supported via `haskell-literate-mode'.
The variable `haskell-literate' indicates the style of the script in the
current buffer. See the documentation on this variable for more details.
Use `haskell-version' to find out what version of Haskell mode you are
currently using.
Additional Haskell mode modules can be hooked in via `haskell-mode-hook'.
Indentation modes:
`haskell-indentation-mode', Kristof Bastiaensen, Gergely Risko
Intelligent semi-automatic indentation Mk2
`haskell-indent-mode', Guy Lapalme
Intelligent semi-automatic indentation.
Interaction modes:
`interactive-haskell-mode'
Interact with per-project GHCi processes through a REPL and
directory-aware sessions.
Other modes:
`haskell-decl-scan-mode', Graeme E Moss
Scans top-level declarations, and places them in a menu.
`haskell-doc-mode', Hans-Wolfgang Loidl
Sets up eldoc to echo types of functions or syntax of keywords
when the cursor is idle.
To activate a minor-mode, simply run the interactive command. For
example, `M-x haskell-doc-mode'. Run it again to disable it.
To enable a mode for every `haskell-mode' buffer, add a hook in
your Emacs configuration. To do that you can customize
`haskell-mode-hook' or add lines to your .emacs file. For
example, to enable `interactive-haskell-mode', use the following:
(add-hook \\='haskell-mode-hook \\='interactive-haskell-mode)
Minor modes that work well with `haskell-mode':
- `smerge-mode': show and work with diff3 conflict markers used
by git, svn and other version control systems."
:group 'haskell
(when (version< emacs-version "25.1")
(error "haskell-mode requires at least Emacs 25.1"))
;; paragraph-{start,separate} should treat comments as paragraphs as well.
(setq-local paragraph-start (concat " *{-\\([^#]\\|$\\)\\| *-- |\\|" page-delimiter))
(setq-local paragraph-separate (concat " *$\\| *\\({-\\([^#]\\|$\\)\\|\\([^#]\\|^\\)-}\\) *$\\|" page-delimiter))
(setq-local fill-paragraph-function 'haskell-fill-paragraph)
;; (setq-local adaptive-fill-function 'haskell-adaptive-fill)
(setq-local comment-start "--")
(setq-local comment-padding 1)
(setq-local comment-start-skip "[-{]-[ \t]*")
(setq-local comment-end "")
(setq-local comment-end-skip "[ \t]*\\(-}\\|\\s>\\)")
(setq-local forward-sexp-function #'haskell-forward-sexp)
(setq-local parse-sexp-ignore-comments nil)
(setq-local syntax-propertize-function #'haskell-syntax-propertize)
;; Set things up for imenu.
(setq-local imenu-create-index-function 'haskell-ds-create-imenu-index)
;; Set things up for font-lock.
(setq-local font-lock-defaults
'((haskell-font-lock-keywords)
nil nil nil nil
(font-lock-syntactic-face-function
. haskell-syntactic-face-function)
;; Get help from font-lock-syntactic-keywords.
(parse-sexp-lookup-properties . t)
(font-lock-extra-managed-props . (composition haskell-type))))
;; Preprocessor definitions can have backslash continuations
(setq-local font-lock-multiline t)
;; Haskell's layout rules mean that TABs have to be handled with extra care.
;; The safer option is to avoid TABs. The second best is to make sure
;; TABs stops are 8 chars apart, as mandated by the Haskell Report. --Stef
(setq-local indent-tabs-mode nil)
(setq-local tab-width 8)
(setq-local comment-auto-fill-only-comments t)
;; Haskell is not generally suitable for electric indentation, since
;; there is no unambiguously correct indent level for any given line.
(when (boundp 'electric-indent-inhibit)
(setq electric-indent-inhibit t))
;; dynamic abbrev support: recognize Haskell identifiers
;; Haskell is case-sensitive language
(setq-local dabbrev-case-fold-search nil)
(setq-local dabbrev-case-distinction nil)
(setq-local dabbrev-case-replace nil)
(setq-local dabbrev-abbrev-char-regexp "\\sw\\|\\s_\\|[.]")
(setq haskell-literate nil)
(add-hook 'before-save-hook 'haskell-mode-before-save-handler nil t)
(add-hook 'after-save-hook 'haskell-mode-after-save-handler nil t)
;; provide non-interactive completion function
(add-hook 'completion-at-point-functions
'haskell-completions-completion-at-point
nil
t)
;; Avoid Emacs 25 bug with electric-pair inside comments
(when (eq 25 emacs-major-version)
(setq-local electric-pair-inhibit-predicate 'haskell-mode--inhibit-bracket-inside-comment-or-default))
(haskell-indentation-mode))