Function: editorconfig-fnmatch-translate

editorconfig-fnmatch-translate is a byte-compiled function defined in editorconfig-fnmatch.el.gz.

Signature

(editorconfig-fnmatch-translate PATTERN)

Documentation

Translate a shell PATTERN to a regular expression.

Translation result will be cached, so same translation will not be done twice.

Source Code

;; Defined in /usr/src/emacs/lisp/editorconfig-fnmatch.el.gz
;;(editorconfig-fnmatch-translate "{a,{-3..3}}.js")
;;(editorconfig-fnmatch-p "1.js" "{a,{-3..3}}.js")

(defun editorconfig-fnmatch-translate (pattern)
  "Translate a shell PATTERN to a regular expression.

Translation result will be cached, so same translation will not be done twice."
  (let ((cached (gethash pattern
                         editorconfig-fnmatch--cache-hashtable)))
    (or cached
        (puthash pattern
                 (editorconfig-fnmatch--do-translate pattern)
                 editorconfig-fnmatch--cache-hashtable))))