Skip to content

Commit

Permalink
Fix wrong examples of syntax highlighting customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
ubolonton committed Jul 21, 2020
1 parent 33ab0f1 commit 9505a9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions doc/emacs-tree-sitter.org
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ By default, when the highlighting query associates a node with ~CAPTURE-NAME~, i
# TODO: Screenshots.
#+begin_src emacs-lisp
;; Don't highlight strings, in any language.
(add-function :before-while 'tree-sitter-hl-face-mapping-function
(add-function :before-while tree-sitter-hl-face-mapping-function
(lambda (capture-name)
(not (string= capture-name "string"))))
#+end_src
Expand Down Expand Up @@ -368,7 +368,7 @@ Adding language-specific patterns:
Adding buffer-local patterns:
#+begin_src emacs-lisp
;; Map @rust.unsafe.use capture to a custom face.
(add-function :before-until 'tree-sitter-hl-face-mapping-function
(add-function :before-until tree-sitter-hl-face-mapping-function
(lambda (capture-name)
(pcase capture-name
("rust.unsafe.use" 'my-dangerous-code-pattern-face))))
Expand All @@ -385,7 +385,6 @@ Adding project-specific patterns through ~.dir-locals.el~:
#+begin_src emacs-lisp
;; Highlight DEFUN macros (in Emacs's C source).
((c-mode . ((tree-sitter-hl--extra-patterns-list
.
[((call_expression
function: (identifier) @keyword
arguments: (argument_list
Expand Down
2 changes: 1 addition & 1 deletion langs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Unreleased

## 0.7.0
- Replaced `#` with `.` in bundled highlighting queries' predicates origin/query-dot-predicate.
- Replaced `#` with `.` in bundled highlighting queries' predicates.

## 0.6.0
- Fixed the issue of `tree-sitter-langs` not being able to find grammars in gccemacs.
Expand Down

0 comments on commit 9505a9f

Please sign in to comment.