Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clash with dired-subtree #9

Open
amno1 opened this issue Dec 23, 2020 · 3 comments
Open

Clash with dired-subtree #9

amno1 opened this issue Dec 23, 2020 · 3 comments

Comments

@amno1
Copy link

amno1 commented Dec 23, 2020

I just installed this package, and am testing it around a bit. I see there is apparently some clash with dired subtree.

https://github.com/Fuco1/dired-hacks/blob/master/dired-subtree.el

When I enable details in dired-git-info I am not able to toggle subdirectories, but works fine when I disable details in dgi. I haven't had time to investigate it yet.

Looks great otherwise. Didn't know it existed before. A clear star!

@danilevy1212
Copy link

Stumbled upon the same issue, any suggestions?

@amno1
Copy link
Author

amno1 commented Jan 14, 2022

You could use this as a quick hack:

(defun dired-subtree-toggle-advice (orig-fn &rest args)
  (cond ((bound-and-true-p dired-git-info-mode)
         (dired-git-info-mode -1)
         (apply orig-fn args)
         (dired-git-info-mode +1))
        (t (apply orig-fn args))))

(advice-add 'dired-subtree-toggle :around #'dired-subtree-toggle-advice)

It is not the most efficient thing to do, but it works. It will only work at the top level. If you would like to see git info displayed in the inserted subdirectory or skip the advising, you can hack 'dired-subtree-toggle' and replace it with your own one.

If you wish to disable the hack:

(advice-remove 'dired-subtree-toggle #'dired-subtree-toggle-advice)

@danilevy1212
Copy link

@amno1 Thanks a lot, that works pretty well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants