branch: elpa/yaml-mode commit 3dc22127daa6788bad2934485785c45231c416f9 Author: Vasilij Schneidermann <v.schneiderm...@gmail.com> Commit: Vasilij Schneidermann <v.schneiderm...@gmail.com>
Remove obsolete `font-lock-syntactic-keywords` use --- yaml-mode.el | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/yaml-mode.el b/yaml-mode.el index a04fc13..3b01a15 100644 --- a/yaml-mode.el +++ b/yaml-mode.el @@ -222,13 +222,10 @@ that key is pressed to begin a block literal." (set (make-local-variable 'indent-line-function) 'yaml-indent-line) (set (make-local-variable 'indent-tabs-mode) nil) (set (make-local-variable 'fill-paragraph-function) 'yaml-fill-paragraph) - (set (make-local-variable 'font-lock-defaults) - '(yaml-font-lock-keywords - nil nil nil nil - (font-lock-syntactic-keywords . yaml-font-lock-syntactic-keywords))) (set (make-local-variable 'syntax-propertize-function) 'yaml-mode-syntax-propertize-function) + (setq font-lock-defaults '(yaml-font-lock-keywords)) (if (fboundp 'font-lock-flush) (font-lock-flush) (with-no-warnings @@ -248,10 +245,6 @@ that key is pressed to begin a block literal." ("^[\t]+" 0 'yaml-tab-face t)) "Additional expressions to highlight in YAML mode.") -(defvar yaml-font-lock-syntactic-keywords - (list '(yaml-syntactic-block-literals 0 ".")) - "Additional syntax features to highlight in YAML mode.") - (defun yaml-mode-syntax-propertize-function (beg end) "Unhighlight foo#bar tokens between BEG and END." (save-excursion @@ -304,26 +297,6 @@ artificially limitted to the value of bound t)) (set-match-data (nthcdr 2 (match-data))) t)))))) -(defun yaml-syntactic-block-literals (bound) - "Find quote characters within block literals. -Finds the first quote character within a block literal (if any) after -point and prior to BOUND. Returns the position of the quote character -in the match data, as consumed by matcher functions in -`font-lock-syntactic-keywords'. This allows the mode to treat ['\"] -characters in block literals as punctuation syntax instead of string -syntax, preventing unmatched quotes in block literals from painting -the entire buffer in `font-lock-string-face'." - (let ((found nil)) - (while (and (not found) - (/= (point) bound) - (yaml-font-lock-block-literals bound)) - (let ((begin (match-beginning 0)) (end (match-end 0))) - (goto-char begin) - (cond - ((re-search-forward "['\"]" end t) (setq found t)) - ((goto-char end))))) - found)) - ;; Indentation and electric keys