yoshiki / yaml-mode

The emacs major mode for editing files in the YAML data serialization format.
GNU General Public License v3.0
487 stars 132 forks source link

Show-Paren minor mode doesn't highlight parentheses with yaml-mode #84

Open hamelg opened 3 years ago

hamelg commented 3 years ago

Show-Paren is very useful when editing code in Yaml Block scalars. Unfortunately, it doesn't display the parenthesis matches.

Is there any reason to modify the yaml-mode syntax table with these 2 characters :

(modify-syntax-entry ?\( "." syntax-table)
(modify-syntax-entry ?\) "." syntax-table)

Show-Paren needs this syntax to highlight parentheses :

(modify-syntax-entry ?\( "()" yaml-mode-syntax-table)
(modify-syntax-entry ?\) ")(" yaml-mode-syntax-table)

Thanks

wasamasa commented 3 years ago

As per the YAML specification 1.2 section 7.4 only [] and {} have special delimiter-like meaning: https://yaml.org/spec/1.2/spec.html#id2790088

That being said, I don't see the harm in adding () to the list. These characters are only mentioned in the standard as valid URI characters.