Skip to content

Commit bcdd8d4

Browse files
committed
Merge pull request #1263 from gracjan/pr-expand-font-lock-manual
Expand font lock chapter
2 parents 59b6a55 + 2041346 commit bcdd8d4

File tree

3 files changed

+49
-30
lines changed

3 files changed

+49
-30
lines changed

doc/anim/font-lock-quasi-quotes.gif

60.8 KB
Loading

doc/anim/font-lock-types.gif

71.4 KB
Loading

doc/haskell-mode.texi

+49-30
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ interpreter (e.g. GHCi).
5252
* Introduction:: An introduction to Haskell Mode
5353
* Installation:: How to get started
5454
* Editing Haskell Code:: How to edit code
55+
* Font Lock Support:: Haskell Mode has colors
56+
* Completion support:: Autocomplete
5557
* Unicode support:: How to use Unicode
5658
* Indentation:: Notes about indentation
5759
* External indentation:: Other ways to indent code
@@ -66,7 +68,7 @@ interpreter (e.g. GHCi).
6668
* Browsing Haddocks:: Using @code{w3m} to browse documentation
6769
* Spell checking strings and comments:: Using @code{flyspell-prog-mode}
6870
* Aligning code:: Aligning code using @code{align-regexp}
69-
* Rectangular commands::
71+
* Rectangular commands:: Manage indentation manually
7072
* Getting Help and Reporting Bugs:: How to improve Haskell Mode
7173
* Concept index:: Index of Haskell Mode concepts
7274
* Function index:: Index of commands
@@ -250,24 +252,6 @@ literate Haskell files. The currently detected literate Haskell variant
250252
is shown in the mode line (@pxref{Mode Line,,,emacs}) as either
251253
@samp{LitHaskell/bird} or @samp{LitHaskell/tex}.
252254

253-
@section Font Lock Support
254-
255-
@code{haskell-mode} supports @dfn{syntax highlighting} via Emacs' Font
256-
Lock minor mode which should be enabled by default in current
257-
Emacsen. @xref{Font Lock,,,emacs}, for more information on how to
258-
control @code{font-lock-mode}.
259-
260-
@ifhtml
261-
@image{anim/font-lock}
262-
@end ifhtml
263-
264-
Syntax highlighting facilities parse strings and string escape sequences
265-
and are able to highlight unrecognized constructs.
266-
267-
@ifhtml
268-
@image{anim/string-escape-highlight}
269-
@end ifhtml
270-
271255

272256
@section Managing imports
273257

@@ -332,7 +316,52 @@ automatically, this can be done by customizing
332316
@code{tags-revert-without-query} variable (either globally or for
333317
Haskell buffers only).
334318

335-
@section Completion support
319+
@section Profiling and Debugging support
320+
321+
When profiling code with GHC, it is often useful to add
322+
@uref{https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#cost-centres,
323+
cost centres} by hand. These allow finer-grained information about
324+
program behavior. @code{haskell-mode} provides the function
325+
@code{haskell-mode-toggle-scc-at-point} to make this more convenient.
326+
It will remove an SCC annotation at point if one is present, or add
327+
one if point is over whitespace. By default it is bound to @kbd{C-c C-s}.
328+
329+
@node Font Lock Support
330+
@chapter Font Lock Support
331+
332+
@code{haskell-mode} supports @dfn{syntax highlighting} via Emacs' Font
333+
Lock minor mode which should be enabled by default in current
334+
Emacsen. @xref{Font Lock,,,emacs}, for more information on how to
335+
control @code{font-lock-mode}.
336+
337+
@ifhtml
338+
@image{anim/font-lock}
339+
@end ifhtml
340+
341+
Syntax highlighting facilities parse strings and string escape sequences
342+
and are able to highlight unrecognized constructs.
343+
344+
@ifhtml
345+
@image{anim/string-escape-highlight}
346+
@end ifhtml
347+
348+
Haskell Mode shows keywords, identifiers, operators, constructors and
349+
types in different colors.
350+
351+
@ifhtml
352+
@image{anim/font-lock-types}
353+
@end ifhtml
354+
355+
There is also support to use mode-specific syntax highlighing for
356+
quasiquotes. Customize @code{haskell-font-lock-quasi-quote-modes} to
357+
make sure your quoters are supported.
358+
359+
@ifhtml
360+
@image{anim/font-lock-quasi-quotes}
361+
@end ifhtml
362+
363+
@node Completion support
364+
@chapter Completion support
336365

337366
@code{haskell-mode} can complete symbols, pragma directives, language
338367
extensions, and language keywords out-of-box. @code{haskell-mode}
@@ -376,16 +405,6 @@ example:
376405
company-backends))))
377406
@end lisp
378407

379-
@section Profiling and Debugging support
380-
381-
When profiling code with GHC, it is often useful to add
382-
@uref{https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#cost-centres,
383-
cost centres} by hand. These allow finer-grained information about
384-
program behavior. @code{haskell-mode} provides the function
385-
@code{haskell-mode-toggle-scc-at-point} to make this more convenient.
386-
It will remove an SCC annotation at point if one is present, or add
387-
one if point is over whitespace. By default it is bound to @kbd{C-c C-s}.
388-
389408
@node Unicode support
390409
@chapter Unicode support
391410

0 commit comments

Comments
 (0)