Skip to content

Commit 117a660

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 0f679b1 commit 117a660

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
;;
@@ -417,73 +429,6 @@ that should be commented under LaTeX-style literate scripts."
417429
;; Get help from font-lock-syntactic-keywords.
418430
(parse-sexp-lookup-properties . t))))
419431

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

489434
;; Local Variables:

0 commit comments

Comments
 (0)