Skip to content

Commit da1e8e4

Browse files
committed
Remove turn-on-purescript-font-lock and turn-off-purescript-font-lock
The functions provide no useful cases because font-locking is enabled by default and can be disabled by turning off font-lock (which the "turn-off" function is a wrapper over). At the same time, the function constitutes huge chunk of the code and comes up while trying to figure where things are called from. Basically, the functions are just duplicating the functional, and I'm hoping they have no users. Turns out also, the function removal was attempted in 0a9580d, however… I am not exactly sure what went wrong but the author only posted the NEWS entry about the functions being removed, but made no chages regarding them.
1 parent a38fcef commit da1e8e4

File tree

1 file changed

+20
-75
lines changed

1 file changed

+20
-75
lines changed

Diff for: purescript-font-lock.el

+20-75
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,32 @@
3131
;; functions, etc. Supports full PureScript 1.4 as well as LaTeX- and
3232
;; Bird-style literate scripts.
3333
;;
34-
;; Installation:
34+
;; Customisation:
3535
;;
36-
;; To turn font locking on for all PureScript buffers under the PureScript
37-
;; mode of Moss&Thorn, add this to .emacs:
36+
;; Two levels of fontification are defined: level one (the default)
37+
;; and level two (more colour). The former does not colour operators.
38+
;; Use the variable `font-lock-maximum-decoration' to choose
39+
;; non-default levels of fontification. For example, adding this to
40+
;; .emacs:
3841
;;
39-
;; (add-hook 'purescript-mode-hook 'turn-on-purescript-font-lock)
42+
;; (setq font-lock-maximum-decoration \\='((purescript-mode . 2) (t . 0)))
4043
;;
41-
;; Otherwise, call `turn-on-purescript-font-lock'.
44+
;; uses level two fontification for `purescript-mode' and default level for all
45+
;; other modes. See documentation on this variable for further details.
4246
;;
47+
;; To alter an attribute of a face, add a hook. For example, to change the
48+
;; foreground colour of comments to brown, add the following line to .emacs:
4349
;;
44-
;; Customisation:
50+
;; (add-hook \\='purescript-font-lock-hook
51+
;; (lambda ()
52+
;; (set-face-foreground \\='purescript-comment-face \"brown\")))
53+
;;
54+
;; Note that the colours available vary from system to system. To see what
55+
;; colours are available on your system, call `list-colors-display' from emacs.
4556
;;
46-
;; The colours and level of font locking may be customised. See the
47-
;; documentation on `turn-on-purescript-font-lock' for more details.
57+
;; Bird-style literate PureScript scripts are supported: If the value of
58+
;; `purescript-literate-bird-style' (automatically set by the PureScript mode of
59+
;; Moss&Thorn) is non-nil, a Bird-style literate script is assumed.
4860
;;
4961
;; Present Limitations/Future Work (contributions are most welcome!):
5062
;;
@@ -418,73 +430,6 @@ that should be commented under LaTeX-style literate scripts."
418430
;; Get help from font-lock-syntactic-keywords.
419431
(parse-sexp-lookup-properties . t))))
420432

421-
;; The main functions.
422-
(defun turn-on-purescript-font-lock ()
423-
"Turns on font locking in current buffer for PureScript 1.4 scripts.
424-
425-
Changes the current buffer\\='s `font-lock-defaults', and adds the
426-
following variables:
427-
428-
`purescript-keyword-face' for reserved keywords and syntax,
429-
`purescript-constructor-face' for data- and type-constructors, class names,
430-
and module names,
431-
`purescript-operator-face' for symbolic and alphanumeric operators,
432-
`purescript-default-face' for ordinary code.
433-
434-
The variables are initialised to the following font lock default faces:
435-
436-
`purescript-keyword-face' `font-lock-keyword-face'
437-
`purescript-constructor-face' `font-lock-type-face'
438-
`purescript-operator-face' `font-lock-function-name-face'
439-
`purescript-default-face' <default face>
440-
441-
Two levels of fontification are defined: level one (the default)
442-
and level two (more colour). The former does not colour operators.
443-
Use the variable `font-lock-maximum-decoration' to choose
444-
non-default levels of fontification. For example, adding this to
445-
.emacs:
446-
447-
(setq font-lock-maximum-decoration \\='((purescript-mode . 2) (t . 0)))
448-
449-
uses level two fontification for `purescript-mode' and default level for
450-
all other modes. See documentation on this variable for further
451-
details.
452-
453-
To alter an attribute of a face, add a hook. For example, to change
454-
the foreground colour of comments to brown, add the following line to
455-
.emacs:
456-
457-
(add-hook \\='purescript-font-lock-hook
458-
(lambda ()
459-
(set-face-foreground \\='purescript-comment-face \"brown\")))
460-
461-
Note that the colours available vary from system to system. To see
462-
what colours are available on your system, call
463-
`list-colors-display' from emacs.
464-
465-
To turn font locking on for all PureScript buffers, add this to .emacs:
466-
467-
(add-hook \\='purescript-mode-hook \\='turn-on-purescript-font-lock)
468-
469-
To turn font locking on for the current buffer, call
470-
`turn-on-purescript-font-lock'. To turn font locking off in the current
471-
buffer, call `turn-off-purescript-font-lock'.
472-
473-
Bird-style literate PureScript scripts are supported: If the value of
474-
`purescript-literate-bird-style' (automatically set by the PureScript mode
475-
of Moss&Thorn) is non-nil, a Bird-style literate script is assumed.
476-
477-
Invokes `purescript-font-lock-hook' if not nil."
478-
(purescript-font-lock-defaults-create)
479-
(run-hooks 'purescript-font-lock-hook)
480-
(turn-on-font-lock))
481-
482-
(defun turn-off-purescript-font-lock ()
483-
"Turns off font locking in current buffer."
484-
(font-lock-mode -1))
485-
486-
;; Provide ourselves:
487-
488433
(provide 'purescript-font-lock)
489434

490435
;; Local Variables:

0 commit comments

Comments
 (0)