bastibe / annotate.el

Annotate.el
Other
384 stars 20 forks source link

Showing annotations doesn't work #110

Closed Elentirith closed 3 years ago

Elentirith commented 3 years ago

I prefer to see annotations in a new buffer like with describe-function, but when I call the default annotate-summary-of-file-from-current-pos it fails. Poking around I was able to use annotate-show-annotation-summary to get the desired help buffer. I got my version from melpa so if already fixed in the upstream disregard.

cage2 commented 3 years ago

Hi @Elentirith !

I am happy that you find useful annotate-summary-of-file-from-current-pos, that function is a very thin layer of code on top of annotate-show-annotation-summary, as you probably discovered. I am sorry that you get problems with this command but unfortunately i am not able to reproduce it, so need a bit more information to try to reproduce the issue, can you help me answering the questions below?

Thank you! C.

Elentirith commented 3 years ago

The exact error is

Parsing failed:: "Unknown operator: Files/Emacs/x86_64/share/emacs/27.1/lisp/subr.el is not in '(and, or)"

I get it by going to subr.el and highlighting the first line of a function (where it has defun), then go one line up and type M-x annotate-summary-of-file-from-current-pos. I can't consistently reproduce it so I'm not sure what is causing it or why it uses regular expressions to begin with. It doesn't happen in debian so maybe it's a windows problem? I'm on windows 10 here.

I was interested in possibly using this to annotate source code for a git project, so it's interesting it already uses regular expressions. The idea would be to "fuzzy match" a location in a file with both a location and a regexp, so that the annotation could still hold up even if the file changed. Do you think that would be easy to add as a feature?

cage2 commented 3 years ago

Hi @Elentirith !

The exact error is

Parsing failed:: "Unknown operator: Files/Emacs/x86_64/share/emacs/27.1/lisp/subr.el is not in '(and, or)"

OK i think i can understand now the problem, thank you! The problem is that the query parser was not able to parse a path with a space in directory or file name, as you can see the path shown in the error is truncated! ;-)

I pushed the patch in the PR #109 , i would be glad if you could spend some times testing if the problem has gone, thanks in advance!

[...]

I was interested in possibly using this to annotate source code for a git project, so it's interesting it already uses regular expressions. The idea would be to "fuzzy match" a location in a file with both a location and a regexp, so that the annotation could still hold up even if the file changed. Do you think that would be easy to add as a feature?

The idea is nice but unfortunately this would likely require deeply changing the database format and the information it holds, would be easier rewrite it starting the program from zero :)

Probably a way to annotate all matching regular expression could be done but leaving the database with the boundaries of the annotated text, the way is now.

Bye and thanks for your help with this package! C.

Elentirith commented 3 years ago

I'm not sure I'm doing it right but I tried downloading annotate.el raw and eval'ing it but it still produces same problem. Also the version in melpa. If I download from github does it do the latest version?

cage2 commented 3 years ago

Hi @Elentirith !

I'm not sure I'm doing it right but I tried downloading annotate.el raw and eval'ing it but it still produces same problem. Also the version in melpa. If I download from github does it do the latest version?

Sorry, i was not able to explain how to test the branch; getting the source file is OK, just download the patched file here:

https://raw.githubusercontent.com/cage2/annotate.el/fix-replace-button/annotate.el

If you got your file from that branch already, well this is a problem if it still does not works! :-D

Bye and thanks!! C.

Elentirith commented 3 years ago

Hey I tested it with that link you gave and it doesn't give the error. On an unrelated note something in emacs 27.2 makes the help functions from C-h f and also your annotations appear vertical split instead of horizontal split, I'm sure there's a variable that controls that but I can't recall. Thanks for fixing that windows bug!

cage2 commented 3 years ago

Hi @Elentirith !

I am happy that the bug has gone! I would like to mention you in the changelog, can I? I would mention you as "Elentirith"? What do you think, do you agree?

Bye and thanks for reporting and testing! C.

cage2 commented 3 years ago

Hi!

As there are other issues that #109 is going to fix, i prefer to merge the patch as soon as possible. Please just inform me if you want to be mentioned and i will add your name to the NEWS file.

Bye and thanks again! C.

cage2 commented 3 years ago

Hi!

fixed by #109

Thanks! C.