knpatel401 / filetree

filetree is an emacs package for displaying and operating on a file list as a file tree, and for maintaining individual notes for files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(filetree-toggle-info-buffer) add information of a content of a file, without opening it

ouboub opened this issue · comments

Hi

as far as I can see, I can use filetree-toggle-info-buffer when the cursor is on a file name in a dried buffer.

However, the information I can then add is not connected to that specific file I had the cursor on.
Because the note read

  • No File Note Entry

so there is no information about the file, even if I mark the file!

In order to achieve that, I have to open the file using filetree-toggle-info-buffer and then the info line I add is associated with that file.
However, I would like to use the package to give me information about the content of a file, without opening the file.
Could such functionality be implemented?
thanks and regards

Uwe Brauer

Hi @ouboub -- thanks for trying out the package and for the suggestion!
If I understood the request correctly, you'd like to have a way to create a new note directly from a dired buffer (and possibly also from the filetree buffer)--I agree this would be a useful addition. I'll plan to add this functionality; I'll probably get a chance to look into this next weekend.
Thanks!
Ketan

Hi @ouboub , I've made the above changes in the branch issue_14. You can use the command filetree-create-note to create a new note (if it doesn't already exist) for the file at point in either the filetree buffer or dired buffer.

Also, if you'd like to have the notes update as you navigate dired buffers (analogous to the current behavior when navigating the filetree buffer), you can add the following advise in your .emacs:

(advice-add 'dired-next-line :after
            (lambda (&rest args)
              (filetree-update-info-buffer
               (file-truename (dired-get-file-for-visit)))))

I'll plan to test these changes for a bit before merging them into the main branch. Let me know if you happen to try out the changes and run into any issues or have additional suggestions for changes.

Thanks!
Ketan

Thanks if I understand you correctly this is not in MELPA, but just in the github repository? So I clone that uninstall filetree and then report back.

Yeah, that's right, it's not yet on MELPA and currently only on the issue_14 branch, so you would need to install the package from the branch. I'll probably merge into the main branch after testing for a day or two, after which it'll automatically show up on MELPA.

In the meantime I also learned about emacs-dired-annotator, which focus just on annotations for files and directories.

Interesting, thanks for pointing out the package--I'll take a look.

But I also would like to test your package

Thanks!

I pushed some additional changes to support notes for directories (instead of just files) and some clean-up.

The advise call now for info updates when navigating dired is:

(advice-add 'dired-next-line :after
            (lambda (&rest args) (filetree-update-info-buffer)))

Merged into main branch with commit 1c48ef63.