Function: shadow-file-match

shadow-file-match is a byte-compiled function defined in shadowfile.el.gz.

Signature

(shadow-file-match PATTERN FILE &optional REGEXP)

Documentation

Return t if PATTERN matches FILE.

If REGEXP is supplied and non-nil, the file part of the pattern is a regular expression, otherwise it must match exactly. The sites must match---see shadow-same-site. The pattern must be in full Tramp format, but the file can be any valid filename. This function does not do any filename expansion or contraction, you must do that yourself first.

Source Code

;; Defined in /usr/src/emacs/lisp/shadowfile.el.gz
(defun shadow-file-match (pattern file &optional regexp)
 "Return t if PATTERN matches FILE.
If REGEXP is supplied and non-nil, the file part of the pattern is a regular
expression, otherwise it must match exactly.  The sites must
match---see `shadow-same-site'.  The pattern must be in full Tramp format,
but the file can be any valid filename.  This function does not do any
filename expansion or contraction, you must do that yourself first."
 (let* ((pattern-sup (shadow-parse-name pattern))
	(file-sup (shadow-parse-name file)))
   (and (shadow-same-site pattern-sup file-sup)
	(if regexp
	    (string-match
             (tramp-file-name-localname pattern-sup)
             (tramp-file-name-localname file-sup))
	  (string-equal
           (tramp-file-name-localname pattern-sup)
           (tramp-file-name-localname file-sup)))
        t)))