dired-hacks icon indicating copy to clipboard operation
dired-hacks copied to clipboard

[dired-filter] `dired-filter-group-mode` breaks batch byte compilation

Open ksqsf opened this issue 2 years ago • 4 comments

In a directory where there are a number of .el files, mark them, and then press B to byte-compile them.

Expected behavior: Produce a number of .elc files corresponding to each marked .el file.

Actual behavior: Byte-compile the first marked file again and again infinitely.

My dired-filter config is as follows

(use-package dired-filter
  :after (dired)
  :hook ((dired-mode . dired-filter-group-mode))
  :config
  (define-key dired-mode-map "/" dired-filter-map))

Other information:

  • Emacs version: 29.0.60 (I can confirm batch compilation works without dired-filter-group-mode)
  • Dired-filter version: 20221127.1247 from MELPA

ksqsf avatar Nov 29 '22 07:11 ksqsf

I tried this on Emacs 30 (snapshot) and can't reproduce the issue. Is there any other details you can share? For example what are your filters? Maybe there is some bug in the filtering process which would cause infinite loop.

Fuco1 avatar Mar 16 '23 09:03 Fuco1

My entire config for dired-filter is as follows. The bug can be reproduced using emacs -q + this config.

(use-package dired-filter
  :after (dired)
  :hook ((dired-mode . dired-filter-group-mode)
         (dired-mode . dired-filter-mode))
  :config
  (define-key dired-mode-map "/" dired-filter-map)
  (setq dired-filter-group-saved-groups
        '(("default"
           ("Git"
            (directory . ".git")
            (file . ".gitignore"))
           ("Directory"
            (directory))
           ("PDF"
            (extension . "pdf"))
           ("LaTeX"
            (extension "tex" "bib"))
           ("Code"
            (extension "rs" "c" "cpp" "h" "hpp" "cc" "rb" "py" "el" "html" "js" "css" "jl" "rs" "m" "v" "hs" "lhs" "pl"))
           ("Text"
            (extension "md" "rst" "txt"))
           ("Org"
            (extension "org"))
           ("Archives"
            (extension "zip" "rar" "tar" "gz" "bz2" "xz"))
           ("Images"
            (extension "jpg" "jpeg" "webp" "png" "bmp" "gif" "tiff" "xcf"))))))

ksqsf avatar Mar 16 '23 09:03 ksqsf

With your config I can reproduce this on snapshot.

Fuco1 avatar Mar 16 '23 09:03 Fuco1

Actually I can reproduce it even on Emacs 28. It has to do with dired-byte-compile "refreshing" the buffer, dired-filter reordering the lines and markers moving around :/ This will be very hard to fix.

Fuco1 avatar Mar 16 '23 10:03 Fuco1