emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/yaml-mode 3dc2212 065/124: Remove obsolete `font-lock-synt


From: ELPA Syncer
Subject: [nongnu] elpa/yaml-mode 3dc2212 065/124: Remove obsolete `font-lock-syntactic-keywords` use
Date: Sun, 29 Aug 2021 11:36:14 -0400 (EDT)

branch: elpa/yaml-mode
commit 3dc22127daa6788bad2934485785c45231c416f9
Author: Vasilij Schneidermann <v.schneidermann@gmail.com>
Commit: Vasilij Schneidermann <v.schneidermann@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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]