Skip to content

Commit 6013ae4

Browse files
committed
Merge pull request #568 from gracjan/pr-cleanup-haskell-mode-hook
Clean up haskell-mode-hook.
2 parents 2497451 + 85a3cd3 commit 6013ae4

File tree

1 file changed

+46
-65
lines changed

1 file changed

+46
-65
lines changed

haskell-mode.el

Lines changed: 46 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -552,94 +552,75 @@ May return a qualified name."
552552
:type 'boolean
553553
:group 'haskell-interactive)
554554

555-
(defcustom haskell-mode-hook nil
556-
"Hook run after entering `haskell-mode'.
555+
(defvar eldoc-print-current-symbol-info-function)
556+
557+
;; For compatibility with Emacs < 24, derive conditionally
558+
(defalias 'haskell-parent-mode
559+
(if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
560+
561+
;; The main mode functions
562+
;;;###autoload
563+
(define-derived-mode haskell-mode haskell-parent-mode "Haskell"
564+
"Major mode for editing Haskell programs.
557565
558-
You may be looking at this documentation because you haven't
559-
configured indentation or process interaction.
566+
For more information aee also Info node `(haskell-mode)Getting Started'.
567+
568+
\\<haskell-mode-map>
569+
570+
Literate Haskell scripts are supported via `literate-haskell-mode'.
571+
The variable `haskell-literate' indicates the style of the script in the
572+
current buffer. See the documentation on this variable for more details.
573+
574+
Use `haskell-version' to find out what version of Haskell mode you are
575+
currently using.
576+
577+
Additional Haskell mode modules can be hooked in via `haskell-mode-hook'.
560578
561579
Indentation modes:
562580
563-
`haskell-indentation-mode', Kristof Bastiaensen
564-
Intelligent semi-automatic indentation Mk2
581+
`haskell-indentation-mode', Kristof Bastiaensen, Gergely Risko
582+
Intelligent semi-automatic indentation Mk2
565583
566-
`haskell-indent-mode', Guy Lapalme
567-
Intelligent semi-automatic indentation.
584+
`haskell-indent-mode', Guy Lapalme
585+
Intelligent semi-automatic indentation.
568586
569-
`haskell-simple-indent-mode', Graeme E Moss and Heribert Schuetz
570-
Simple indentation.
587+
`haskell-simple-indent-mode', Graeme E Moss and Heribert Schuetz
588+
Simple indentation.
571589
572590
Interaction modes:
573591
574-
`interactive-haskell-mode'
575-
Interact with per-project GHCi processes through a REPL and
576-
directory-aware sessions.
592+
`interactive-haskell-mode'
593+
Interact with per-project GHCi processes through a REPL and
594+
directory-aware sessions.
577595
578-
`inf-haskell-mode'
579-
Interact with a GHCi process using comint-mode. Deprecated.
596+
`inf-haskell-mode'
597+
Interact with a GHCi process using comint-mode. Deprecated.
580598
581599
Other modes:
582600
583-
`haskell-decl-scan-mode', Graeme E Moss
584-
Scans top-level declarations, and places them in a menu.
601+
`haskell-decl-scan-mode', Graeme E Moss
602+
Scans top-level declarations, and places them in a menu.
585603
586-
`haskell-doc-mode', Hans-Wolfgang Loidl
587-
Echoes types of functions or syntax of keywords when the cursor is idle.
604+
`haskell-doc-mode', Hans-Wolfgang Loidl
605+
Echoes types of functions or syntax of keywords when the cursor is idle.
588606
589607
To activate a minor-mode, simply run the interactive command. For
590608
example, `M-x haskell-doc-mode'. Run it again to disable it.
591609
592610
To enable a mode for every haskell-mode buffer, add a hook in
593-
your Emacs configuration. For example, to enable
594-
haskell-indent-mode and interactive-haskell-mode, use the
595-
following:
611+
your Emacs configuration. To do that you can customize
612+
`haskell-mode-hook' or add lines to your .emacs file. For
613+
example, to enable `haskell-indent-mode' and
614+
`interactive-haskell-mode', use the following:
596615
597-
(add-hook 'haskell-mode-hook 'haskell-indent-mode)
598-
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
616+
(add-hook 'haskell-mode-hook 'haskell-indentation-mode)
617+
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
599618
600-
See Info node `(haskell-mode)haskell-mode-hook' for more details.
619+
For more details see Info node `(haskell-mode)haskell-mode-hook'.
601620
602-
Warning: do not enable more than one of the three indentation
621+
Warning: do not enable more than one of the above indentation
603622
modes. See Info node `(haskell-mode)indentation' for more
604-
details."
605-
:type 'hook
606-
:group 'haskell
607-
:link '(info-link "(haskell-mode)haskell-mode-hook")
608-
:link '(function-link haskell-mode)
609-
:options `(capitalized-words-mode
610-
imenu-add-menubar-index
611-
turn-on-eldoc-mode
612-
turn-on-haskell-decl-scan
613-
turn-on-haskell-doc
614-
turn-on-haskell-indent
615-
turn-on-haskell-indentation
616-
turn-on-haskell-simple-indent
617-
turn-on-haskell-unicode-input-method))
618-
619-
(defvar eldoc-print-current-symbol-info-function)
620-
621-
;; For compatibility with Emacs < 24, derive conditionally
622-
(defalias 'haskell-parent-mode
623-
(if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
624-
625-
;; The main mode functions
626-
;;;###autoload
627-
(define-derived-mode haskell-mode haskell-parent-mode "Haskell"
628-
"Major mode for editing Haskell programs.
629-
630-
See also Info node `(haskell-mode)Getting Started' for more
631-
information about this mode.
632-
633-
\\<haskell-mode-map>
634-
Literate scripts are supported via `literate-haskell-mode'.
635-
The variable `haskell-literate' indicates the style of the script in the
636-
current buffer. See the documentation on this variable for more details.
637-
638-
Use `haskell-version' to find out what version of Haskell mode you are
639-
currently using.
640-
641-
Additional Haskell mode modules can be hooked in via `haskell-mode-hook';
642-
see documentation for that variable for more details.
623+
details.
643624
644625
Minor modes that work well with `haskell-mode':
645626

0 commit comments

Comments
 (0)