-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add keyboard annotation command #29
base: master
Are you sure you want to change the base?
Add keyboard annotation command #29
Conversation
c8c7136
to
a2aa2f5
Compare
a2aa2f5
to
66d7f9f
Compare
Hi @dalanicolai, I went through the code you have attached. It cleverly sets up However, I want to see this functionality implemented on the back of I imagine the work flow would be exactly as it is in any normal Emacs
I will leave this PR open for folks who will find this patch useful, |
@vedang Your idea sounds nice, but I guess it will be quite cumbersome to implement this with only the current set of query functions available. As far as I know the current set only offers the possibility to either obtain all text-regions on a page in full-text blocks, or otherwise obtain a single region by searching for some regexp/string match. I have implemented such annotation functionality for pdf-tools in pymupdf-mode. Pymupdf is another option that can be used for retrieving text-regions structured by characters/words/lines. Now that I wrote this, I actually realize that you can also use mutool to extract 'structured-text' from a pdf, but it only returns structured-xml structured by char (e.g. Btw, just thinking with you... |
Although I like the idea of what you are suggesting, after thinking a little more I would say it is more cumbersome than my current implementation. I already have a command to highlight a single word by typing it (or part of it). And as far as I understand, you intend to set the start position by searching for a word, which is what I do now also. But then you would like to expand the region with those keys, while I simply ask to type a second pattern to put the end mark of the region. So I think in practice, the current implementation is simpler and faster. Instead of using the existing keys to finally create the annotation, here the annotation is created automatically, where I have a customizable default annotation, and otherwise you can prefix the command with a universal argument to select another other annotation style. Did you try out the current implementation? B.t.w. if the pdf would get rendered using librsvg, then the pdf-avy-highlight would work fast also. Which then might be the most convenient implementation. |
This PR adds a keyboard annotation command, to add markup annotations using only the keyboard.
A description for its usage is given in its docstring. No problem if you do not like to merge this, but I guess
some people would like it.