Alexander-Miller / treemacs

GNU General Public License v3.0
2.05k stars 151 forks source link

Emacs auto save files are not shown even when dot file visibility is enabled #1088

Open simurgh9 opened 5 months ago

simurgh9 commented 5 months ago

Emacs stores temporary dot files, e. g., program.c when edited and unsaved for auto-saved-timeout seconds will be copied to something like .#program.c and written on disk. This file shows up as output of ls -a but is not shown even after t h in treemacs.

Is this the expected behaviour? If yes, is there a way to make these visible in treemacs?

Alexander-Miller commented 5 months ago

That is intentional. By default treemacs does not show lock, backup, autosave and flycheck temp files. and the .git directory.

The behavior is controlled by treemacs-ignored-file-predicates which by default contains treemacs--std-ignore-file-predicate which filters all these files. For .git there's also treemacs-hide-dot-git-directory.

simurgh9 commented 3 months ago

I don't usually want to see these files but do you think a toggle for their visibility could be easily achieved?

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).

Alexander-Miller commented 1 month ago

I don't want to build individual toggles for every single file treemacs could ignore, it's not worth the maintenance and complexity effort on my end. However building something for yourself would be pretty simple, as long as you're okay with changing treemacs' entire filter. Just do something like this

(defun filter-toggle ()
  (interactive)
  (if (member #'treemacs--std-ignore-file-predicate treemacs-ignored-file-predicates)
      (setf treemacs-ignored-file-predicates
            (delete #'treemacs--std-ignore-file-predicate treemacs-ignored-file-predicates))
    (setf treemacs-ignored-file-predicates
          (cons #'treemacs--std-ignore-file-predicate treemacs-ignored-file-predicates))))