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

I can add a director using dired-annotator-edit-note but after restarting emacs complains #7

Open
ouboub opened this issue Nov 16, 2023 · 16 comments

Comments

@ouboub
Copy link

ouboub commented Nov 16, 2023

I have my dired-annotator files in ~/emacs/dired-annotation-files/

I then can add via dired-annotator-edit-note add a note to the whole directory and everything looks fine.

However when I restart emacs I receive message like

DIRED-ANNOTATOR:0: could not read the annotation reference from file 11c9d130-e287-e874-3d2b-df5323f57fcb.org
DIRED-ANNOTATOR:0: could not read the annotation reference from file 6a1747c6-c751-2094-b883-56f5a080964c.org
DIRED-ANNOTATOR:0: could not read the annotation reference from file 8fc416e7-90ac-f424-7d83-94f1bdb15141.org
DIRED-ANNOTATOR:0: could not read the annotation reference from file e254763b-eeea-0294-112b-fd81fc3923b8.org
DIRED-ANNOTATOR:0: could not read the annotation reference from file ef79d397-7398-9c44-fb83-45c678cb37c3.org

What do I miss?
regards
Uwe Brauer

@gunther-bachmann
Copy link
Owner

gunther-bachmann commented Nov 17, 2023

Given the log message, something goes wrong reading the annotation files (the files holding the actual annotation).

This happens if either the file is not found or the file found does not contain the expected (generated) data in the properties of the org file.

I can think of two things that might go wrong:
Please check whether the given files are located in the folder your configured dired-annotator-annotations-folder.
Please check whether the files, if they exist, have properties containing data like this:
#+title: SOME TITLE #+property: file-information ("09905bb68ad0c6a50440f1afe16d524e" "FOLDER" "ANNOTATED-FILE" 2177122988 "2022-10-16T20:24:26" immutable-file)

In case this does not help, please increase the log level. That might give you some hint on what actually goes wrong (see https://github.com/gunther-bachmann/emacs-dired-annotator#reporting-issues). Currently it sounds like something that could be solved through configuration changes (hopefully).

Kind regards
Gunther

@gunther-bachmann
Copy link
Owner

Oh, and by the way, guess I have no check for that but

folders cannot be annotated (currently).

(Just in case you tried that)

@ouboub
Copy link
Author

ouboub commented Nov 17, 2023

Step to reproduce the behavior:

Put the cursor on a directory not a file For example

  drwxr-xr-x  9 oub oub 4,0K ago 18  2022 site-lisp
                                          ^ cursor

Run dired-annotator-edit-note Chose immutable-location

Generated org file looks like:


#+title: site-lisp
#+property: file-information ("head: error reading '/home/oub/ALLES/emacs/site-lisp': Is a directory
d41d8cd98f00b204e9800998ecf8427e" "/home/oub/ALLES/emacs/" "site-lisp" 4096 "2022-08-18T15:47:58" immutable-location)
* Note: directory 

I also attach this file, so it seems that the dired annotator, does not reject, adding a note to a directory but then generates a file with syntax errors. regards

Uwe Brauer
99e394d0-2917-cb64-bb5b-722c0c47992b.txt

@ouboub
Copy link
Author

ouboub commented Nov 17, 2023

Oh, and by the way, guess I have no check for that but

folders cannot be annotated (currently).

(Just in case you tried that)

oh yes I tried, it (I consider it as very useful BTW) dired-annotar did not protest, so I thought...
but I did not read carefully enough, sorry

any chance to add this feature ?

@ouboub
Copy link
Author

ouboub commented Nov 17, 2023

Oh, and by the way, guess I have no check for that but
folders cannot be annotated (currently).
(Just in case you tried that)

oh yes I tried, it (I consider it as very useful BTW) dired-annotar did not protest, so I thought... but I did not read carefully enough, sorry

any chance to add this feature ?

I manually changed

#+title: site-lisp
#+property: file-information ("head: error reading '/home/oub/ALLES/emacs/site-lisp': Is a directory
d41d8cd98f00b204e9800998ecf8427e" "/home/oub/ALLES/emacs/" "site-lisp" 4096 "2022-08-18T15:47:58" immutable-location)
* Note: directory 

to

#+title: site-lisp
#+property: file-information ("d41d8cd98f00b204e9800998ecf8427e" "/home/oub/ALLES/emacs/" "site-lisp" 4096 "2022-08-18T15:47:58" immutable-location)
* Note: directory 

and I could then run

dired-annotator-show-note

and it worked! The icons do not work, however

@gunther-bachmann
Copy link
Owner

Ah, ok, interesting. I'll have a closer look at that. Looks like the feature could be implemented without too much effort ...

Concerning the (note) icons: Do they show for files? Or do they not show at all?

@ouboub
Copy link
Author

ouboub commented Nov 21, 2023 via email

@gunther-bachmann
Copy link
Owner

I got the spot that is responsible for that (haven't changed anything here for a long time).
I'm just about to create a new version. Hope it works for directories now, too.

@gunther-bachmann
Copy link
Owner

Please check with version v0.0.7, this should work with directories, too

@ouboub
Copy link
Author

ouboub commented Nov 21, 2023

Please check with version v0.0.7, this should work with directories, too

Thanks, I pulled, recompiled, restarted emacs, and tried to use

 dired-annotator-edit-note

but the result is

#+title: auctex-private-style
#+property: file-information ("if: Expression Syntax.
then: Command not found.
else: endif not found.
fi: Command not found.
d41d8cd98f00b204e9800998ecf8427e" "/home/oub/ALLES/emacs/site-lisp/" "auctex-private-style" 4096 "2023-11-12T16:22:49" immutable-location)
* Note something is not right here

when I then run

dired-annotator-show-icons

I see icons everywhere, even on directories and files that don't have annotations, so something does not work here
emacs-dired-annotate

@ouboub
Copy link
Author

ouboub commented Nov 21, 2023

it is even worse, I went to directory in which only 4 files have annotation, no subdirectory nothing, but now, everything every file and every subdirectory gets an icon. I thought that heppened because I added a note to a directory, but that is not the case

@ouboub
Copy link
Author

ouboub commented Nov 21, 2023

I just checked commit 7ab83bf
there the icons are ok! but only for a moment, I entered a subdirectory that I annoted and returned then every file an directory has an icon. that is a bug, I think

@gunther-bachmann
Copy link
Owner

Ouch. Guess this might work only for my shell. Which shell are you using as a default? The command I added is probably very 'bash' specific. I'll make it more portable.

@gunther-bachmann
Copy link
Owner

I pushed a commit that should fix the problems you described. Could you please check that?
I will tag a new version once I got your problems fixed, so this commit is not tagged (yet).

@ouboub
Copy link
Author

ouboub commented Nov 22, 2023

Ouch. Guess this might work only for my shell. Which shell are you using as a default? The command I added is probably very 'bash' specific. I'll make it more portable.

tcsh

@ouboub
Copy link
Author

ouboub commented Nov 22, 2023

I pushed a commit that should fix the problems you described. Could you please check that? I will tag a new version once I got your problems fixed, so this commit is not tagged (yet).

I pulled, compiled and restarted emacs.
I added a not to directory this time, correctly the following shows up

#+title: auctex-private-style
#+property: file-information ("d4a16ec2c52cf20aeade72a4091c948b" "/home/oub/ALLES/emacs/site-lisp/" "auctex-private-style" 4096 "2023-11-12T16:22:49" immutable-location)
* Note this is where my private auctex style files are stored

also the icons seem ok, see the attached screenshot

thanks a lot, I will continue testing and if I find a problem, I report back
dired-annotator

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