Function: dired--star-or-qmark-p

dired--star-or-qmark-p is a byte-compiled function defined in dired-aux.el.gz.

Signature

(dired--star-or-qmark-p STRING MATCH &optional KEEP START)

Documentation

Return non-nil if STRING contains isolated MATCH or ``?`'.

MATCH should be the strings "?", ``?`', "*" or nil. The latter means STRING contains either "?" or ``?`' or "*". If optional arg KEEP is non-nil, then preserve the match data. Otherwise, this function changes it and saves MATCH as the second match group. START is the position to start matching from.

Isolated means that MATCH is surrounded by spaces or at the beginning/end of STRING followed/prefixed with an space. A match to ``?`', isolated or not, is also valid.

Source Code

;; Defined in /usr/src/emacs/lisp/dired-aux.el.gz
(defun dired--star-or-qmark-p (string match &optional keep start)
  "Return non-nil if STRING contains isolated MATCH or `\\=`?\\=`'.
MATCH should be the strings \"?\", `\\=`?\\=`', \"*\" or nil.  The latter
means STRING contains either \"?\" or `\\=`?\\=`' or \"*\".
If optional arg KEEP is non-nil, then preserve the match data.  Otherwise,
this function changes it and saves MATCH as the second match group.
START is the position to start matching from.

Isolated means that MATCH is surrounded by spaces or at the beginning/end
of STRING followed/prefixed with an space.  A match to `\\=`?\\=`',
isolated or not, is also valid."
  (let ((regexp (dired-isolated-string-re (if match (regexp-quote match) "[*?]"))))
    (when (or (null match) (equal match "?"))
      (cl-callf concat regexp "\\|\\(?1:\\)\\(?2:`\\?`\\)\\(?3:\\)"))
    (funcall (if keep #'string-match-p #'string-match) regexp string start)))