Fuco1 / dired-hacks

Collection of useful dired additions
GNU General Public License v3.0
877 stars 77 forks source link

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

Open ksqsf opened 1 year ago

ksqsf commented 1 year ago

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:

Fuco1 commented 1 year ago

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.

ksqsf commented 1 year ago

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"))))))
Fuco1 commented 1 year ago

With your config I can reproduce this on snapshot.

Fuco1 commented 1 year ago

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.