bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#35564: [PATCH v2] Tweak dired warning about "wildcard" characters


From: npostavs
Subject: bug#35564: [PATCH v2] Tweak dired warning about "wildcard" characters
Date: Thu, 13 Jun 2019 12:53:08 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt)

>
> I think we do care; if I look at what the existing code says,
>
>     (dired--star-or-qmark-p "?`foo`" "?")
>     ;; => nil

>      (let ((start (max 0 (1- pos)))
>            (char (string (aref command pos))))

>                   (rx-to-string '(seq (or bos blank)
>                                       (group char)

`char' in this context translates to the "." regexp (i.e., any
character).  Yeah it's a bit weird.  I have a patch in mind to remove
the need for eval or rx-to-string.  I'll send in a few days (to a new
bug, it's getting off-topic here).

Meanwhile, I suggest:

  (let ((start (max 0 (1- pos)))
        (char (aref command pos)))
    (and (string-match
          (rx-to-string `(or (seq (or bos blank)
                                  (group-n 1 ,char)
                                  (or eos blank))
                             (seq ?` (group-n 1 ,char) ?`)))
          command start)
         (= pos (match-beginning 1))))





reply via email to

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