Function: flymake-proc--get-file-name-mode-and-masks

flymake-proc--get-file-name-mode-and-masks is a byte-compiled function defined in flymake-proc.el.gz.

Signature

(flymake-proc--get-file-name-mode-and-masks FILE-NAME)

Documentation

Return the corresponding entry from flymake-proc-allowed-file-name-masks.

If the FILE-NAME matches a regexp from flymake-proc-ignored-file-name-regexps, flymake-proc-allowed-file-name-masks is not searched.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/flymake-proc.el.gz
(defun flymake-proc--get-file-name-mode-and-masks (file-name)
  "Return the corresponding entry from `flymake-proc-allowed-file-name-masks'.
If the FILE-NAME matches a regexp from `flymake-proc-ignored-file-name-regexps',
`flymake-proc-allowed-file-name-masks' is not searched."
  (unless (stringp file-name)
    (error "Invalid file-name"))
  (if (cl-find file-name flymake-proc-ignored-file-name-regexps
               :test (lambda (fn rex) (string-match rex fn)))
      (flymake-log 3 "file %s ignored")
    (let ((fnm flymake-proc-allowed-file-name-masks)
          (mode-and-masks nil))
      (while (and (not mode-and-masks) fnm)
        (if (string-match (car (car fnm)) file-name)
            (setq mode-and-masks (cdr (car fnm))))
        (setq fnm (cdr fnm)))
      (flymake-log 3 "file %s, init=%s" file-name (car mode-and-masks))
      mode-and-masks)))