Skip to content

Commit

Permalink
Rename literate-haskell-mode to haskell-literate-mode
Browse files Browse the repository at this point in the history
This is part of keeping the package namespace prefix consistent.
  • Loading branch information
purcell committed Apr 8, 2020
1 parent 10a1e90 commit 7ccb1ab
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
10 changes: 5 additions & 5 deletions doc/haskell-mode.texi
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ any function to the list.
Haskell Mode as one of its components provides a major mode for editing
Haskell source code called @code{haskell-mode}, which gave the name to
the whole project. There is a derived mode provided called
@code{literate-haskell-mode} that support Literate Haskell source code
@code{haskell-literate-mode} that support Literate Haskell source code
both in Bird and in Latex forms.

Haskell Mode supports files with the following extensions:
Expand Down Expand Up @@ -2603,19 +2603,19 @@ about Haskell. Once you evaluate this, you can just use @kbd{M-x}
(add-to-list 'align-rules-list
'(haskell-types
(regexp . "\\(\\s-+\\)\\(::\\|∷\\)\\s-+")
(modes quote (haskell-mode literate-haskell-mode))))
(modes quote (haskell-mode haskell-literate-mode))))
(add-to-list 'align-rules-list
'(haskell-assignment
(regexp . "\\(\\s-+\\)=\\s-+")
(modes quote (haskell-mode literate-haskell-mode))))
(modes quote (haskell-mode haskell-literate-mode))))
(add-to-list 'align-rules-list
'(haskell-arrows
(regexp . "\\(\\s-+\\)\\(->\\|→\\)\\s-+")
(modes quote (haskell-mode literate-haskell-mode))))
(modes quote (haskell-mode haskell-literate-mode))))
(add-to-list 'align-rules-list
'(haskell-left-arrows
(regexp . "\\(\\s-+\\)\\(<-\\|←\\)\\s-+")
(modes quote (haskell-mode literate-haskell-mode))))
(modes quote (haskell-mode haskell-literate-mode))))
@end lisp

@node Rectangular commands
Expand Down
2 changes: 1 addition & 1 deletion haskell-decl-scan.el
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ declaration. Therefore, using Haskell font locking with comments
coloured in `font-lock-comment-face' improves declaration scanning.
Literate Haskell scripts are supported: If the value of
`haskell-literate' (set automatically by `literate-haskell-mode')
`haskell-literate' (set automatically by `haskell-literate-mode')
is `bird', a Bird-style literate script is assumed. If it is nil
or `tex', a non-literate or LaTeX-style literate script is
assumed, respectively.
Expand Down
12 changes: 8 additions & 4 deletions haskell-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ With prefix argument HERE, insert it at point."
"If not nil, the current buffer contains a literate Haskell script.
Possible values are: `bird' and `tex', for Bird-style and LaTeX-style
literate scripts respectively. Set by `haskell-mode' and
`literate-haskell-mode'. For an ambiguous literate buffer -- i.e. does
`haskell-literate-mode'. For an ambiguous literate buffer -- i.e. does
not contain either \"\\begin{code}\" or \"\\end{code}\" on a line on
its own, nor does it contain \">\" at the start of a line -- the value
of `haskell-literate-default' is used.")
Expand Down Expand Up @@ -749,7 +749,7 @@ Prefix ARG is handled as per `delete-indentation'."
\\<haskell-mode-map>
Literate Haskell scripts are supported via `literate-haskell-mode'.
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.
Expand Down Expand Up @@ -981,7 +981,7 @@ list marker of some kind), and end of the obstacle."


;;;###autoload
(define-derived-mode literate-haskell-mode haskell-mode "LitHaskell"
(define-derived-mode haskell-literate-mode haskell-mode "LitHaskell"
"As `haskell-mode' but for literate scripts."
(setq haskell-literate
(save-excursion
Expand All @@ -997,12 +997,16 @@ list marker of some kind), and end of the obstacle."
(setq-local fill-paragraph-handle-comment nil))
(setq-local mode-line-process '("/" (:eval (symbol-name haskell-literate)))))

;;;###autoload
(define-obsolete-function-alias 'literate-haskell-mode 'haskell-literate-mode "2020-04")


;;;###autoload
(add-to-list 'auto-mode-alist '("\\.[gh]s\\'" . haskell-mode))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.hsig\\'" . haskell-mode))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.l[gh]s\\'" . literate-haskell-mode))
(add-to-list 'auto-mode-alist '("\\.l[gh]s\\'" . haskell-literate-mode))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.hsc\\'" . haskell-mode))
;;;###autoload
Expand Down
8 changes: 4 additions & 4 deletions tests/haskell-font-lock-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@
("Comment2" t haskell-literate-comment-face)
("code3" t haskell-definition-face)
("Comment3" t haskell-literate-comment-face))
'literate-haskell-mode))
'haskell-literate-mode))

(ert-deftest haskell-literate-bird-2 ()
;; Haskell Report requires empty line before bird code block. So it
Expand All @@ -575,7 +575,7 @@
("Comment2" t haskell-literate-comment-face)
("code3" t haskell-definition-face)
("Comment3" t haskell-literate-comment-face))
'literate-haskell-mode))
'haskell-literate-mode))

(ert-deftest haskell-literate-latex-1 ()
(check-properties
Expand All @@ -597,7 +597,7 @@
("Comment2" t haskell-literate-comment-face)
("code3" t haskell-definition-face)
("Comment3" t haskell-literate-comment-face))
'literate-haskell-mode))
'haskell-literate-mode))

(ert-deftest haskell-literate-mixed-1 ()
;; Although Haskell Report does not advice mixing modes, it is a
Expand All @@ -620,7 +620,7 @@
("Comment2" t haskell-literate-comment-face)
("code3" t haskell-definition-face)
("Comment3" t haskell-literate-comment-face))
'literate-haskell-mode))
'haskell-literate-mode))

(ert-deftest haskell-type-instance ()
"Fontify \"instance\" after \"type\""
Expand Down
4 changes: 2 additions & 2 deletions tests/haskell-indent-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
(should (equal "> literate"
(with-temp-buffer
(insert "literate")
(literate-haskell-mode)
(haskell-literate-mode)
(haskell-indent-put-region-in-literate (point-min) (point-max))
(buffer-substring-no-properties (point-min) (point-max))))))

(ert-deftest haskell-indent-put-region-in-literate-2 ()
(should (equal "literate"
(with-temp-buffer
(insert "> literate")
(literate-haskell-mode)
(haskell-literate-mode)
(haskell-indent-put-region-in-literate (point-min) (point-max) -1)
(buffer-substring-no-properties (point-min) (point-max))))))

Expand Down
4 changes: 2 additions & 2 deletions tests/haskell-lexeme-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ order."
;; Note that all of this should work both in haskell-mode and
;; outside of it. Currently we test only haskell-mode setup.
(if literate
(literate-haskell-mode)
(haskell-literate-mode)
(haskell-mode))

(if (consp lines-or-contents)
Expand Down Expand Up @@ -70,7 +70,7 @@ buffer."
;; Note that all of this should work both in haskell-mode and
;; outside of it. Currently we test only haskell-mode setup.
(if literate
(literate-haskell-mode)
(haskell-literate-mode)
(haskell-mode))

(font-lock-fontify-buffer)
Expand Down

0 comments on commit 7ccb1ab

Please sign in to comment.