Subject: Re: bug#20992: 25.0.50; `virtual-dired': (1) doc typo, (2) unclear

From: Michael Heerdegen <[email-masked]>
Date: Fri, 03 Dec 2021 00:47:07 +0100

Phil Sainty <[email-masked]> writes:

> ;; Recognise saved dired buffers.
> ;; Supports both 'ls' and 'find+ls' dired buffers.
> ;; Regexp is fairly specific, to avoid false-positives.
> (add-to-list 'magic-mode-alist
>              (cons (rx (seq (seq bos "  /" (+ not-newline) ":\n  ")
>                             (or (seq "total used in directory"
>                                      (+ not-newline) "\n" (+ space))
>                                 (seq "find " (+ not-newline) " -ls\n"
>                                      (regexp " +[0-9]+ +[0-9]+ +")))
>                             (regexp "[-d]\\(?:[-r][-w][-xs]\\)\\{3\\}")
>                             (regexp " +[0-9]+ ")))
>                    #'my-dired-virtual-mode))

I wonder if we can get this to work reliably - or if we could instead
make saving dired buffers somehow special, by silently adding some kind
of tag or so.

Michael.