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

Support for showing tooltip on both axis #129

Open
wants to merge 502 commits into
base: master
Choose a base branch
from

Conversation

ahmed-shariff
Copy link

@ahmed-shariff ahmed-shariff commented Oct 2, 2020

This is a solution to #96

I am using the format (page . <horizontal axis> . <vertical axis>) for the INTERLEAVE_PAGE_NOTE/NOTER_PAGE

Work to be done:

  • Adding the function to allow showing tooltip in both axis ( this is basically a copy from Adding image-left as a parameter to specify arrow positions in x-axis politza/pdf-tools#623. Until that gets pulled, i figured will have a copy of it here)
  • View tooltip in both axis
  • Add new precise note with both axis information when no other precise note is added
    • Need to fix a bug with width calculation
    • Only implementing the pdf-tools version of this
  • Allow adding precise note when there is another precise note.
    • Need to refactor the comparison functions to account for this
  • Sorting based on width coordinate
  • Move to using nth instead of cadr or cddr to allow extensions like record start and end of selection or region in precise notes #48
  • The above is replaced with a set of get-location-<position> functions

@ahmed-shariff ahmed-shariff changed the title [WIP] Support for showing tooltip on both axis Support for showing tooltip on both axis Dec 15, 2020
@ahmed-shariff
Copy link
Author

@weirdNox the implementation for now provides support for [page, top and left] coordinates with precise notes while also providing backward compatibility with the [page top] format. The tooltip shows at the beginning of the precise note with the [page top left] format, as opposed showing on the left margin.

Let me know if you think there is anything additional I need to consider.

@czikus
Copy link

czikus commented Jan 13, 2021

Thanks for this PR. Everything works great, but I had to add (require 'pdf-tools) at the top of org-noter.el, otherwise, I'm getting Invalid function (pdf-view-current-overlay) in pdf-util-tooltip-arrow-with-image-left.

@ahmed-shariff
Copy link
Author

Added that to the PR. Thank you for pointing it out 👍

@wos-dot
Copy link

wos-dot commented Oct 12, 2021

Where is the holdup for merging this PR? Seems to me that this is complete. It's a nice feature.

@ahmed-shariff
Copy link
Author

I need to investigate a better way to visualise the arrow. I hadn't been able to get around to it. See politza/pdf-tools#582

@wos-dot
Copy link

wos-dot commented Oct 13, 2021

I see this in the repo

(defun pdf-util-tooltip-in-window (text x y &optional window)
  (let* ((we (window-inside-absolute-pixel-edges window))
         (dx (round (+ x (nth 0 we))))
         (dy (round (+ y (nth 1 we))))
         (tooltip-frame-parameters
          `((left . ,dx)
            (top . ,dy)
            ,@tooltip-frame-parameters)))
    (tooltip-show text)))

Maybe it was fixed, just the issue was not closed? Or am I misreading something?

@gcoladon
Copy link

@weirdNox, may I ask, are you still actively maintaining this repo? I use your library on a daily basis, and would like to make some changes to it (specifically, to address issue 143), I am trying to decide whether to clone your repo or @ahmed-shariff's, which appears to still be under active development?

@c1-g
Copy link

c1-g commented Dec 2, 2021

@gcoladon Nope, he doesn't use this package himself anymore. As you can see, the lastest commit to this repo was 2 years ago and no pull requests gets reviewed at the moment. I decided to fork ahmed-shariff's repo to add some functions I want for the time being.

@ryanakca ryanakca mentioned this pull request Dec 27, 2021
@dmitrym0
Copy link

I'm wondering if anyone's interested in working on a shared fork.

In particular @c1-g's fork appears to be well ahead of the others, notably with overlay support for epubs. It does have many rough edges right now though.

I'd be happy to collaborate; I'm getting up to speed with elisp and I'm already reasonably productive.

petermao and others added 30 commits June 11, 2023 09:57
The event following `C-c C-x` is executed as a keyboard macro in the notes
window.  This generalized `C-c C-x C-v` (`org-toggle-inline-images`) to all
3-key sequences `C-c C-x <event>`.
`other-window` only works if the notes window is in the same frame AND is the
next window in the cycle.

This works for all layouts, using `--get-notes-window` to find the notes window.
This change allows file-rename syncing to happen after the document is
renamed (and the original filepath no longer points to a file).
`dired-rename-file's output is not clear -- it can return nil on a successful
rename, which means :after-until would be the correct conditional :after-x
advice.  Instead, run the check for a successful rename inside
--sync-doc-rename-in-notes and use a straight :after advice.
`..--sync-notes..' updates org noter references to docs in notes files when they
are moved to a different directory.

added enable/disable functions for the --sync-..-rename-.. advising functions.
…w-keybindings

override annoying pdf-view-mode and doc-view-mode keybindings (`C-c C-c` and `C-c C-x`)
With `entitiespretty`, underscores in titles look terrible, but org's emphasis
decorations make them readable again with minimal disturbance.
tablist was failing to load.
…decoration

add optional decoration to headline title
…ment

Feature -- update noter document name in notes file after renames.
pulled in from latest org-noter-pdftools
also a pair of cdr -> cadr for compatibility with 2023 org-noter.
org-pdftools has long-ago settled on "pdf:" via the variable
`org-pdftools-link-prefix'
original code used `file-relative-name', which is more compatible with filename
changes.

`...-path-generator' is written to take only one argument, the
`buffer-file-name'.  May need to write a macro to re-enable relative filenames.
used by `...-pdftools-create-skeleton'
69f8d58: fix org-noter-convert-old-notes
812bbff: nov.el compatibility
a5b61bc: fix for ...-insert-precise-note
corresponds to org-pdftools commit
603962: "fix id related issue"
most of org-pdftools commit
a7915d: new    `...-embed-[all-]org-note-to-pdf' (does this address our Issue weirdNox#49)
        new    `...-embed-org-buffer-to-pdf'
        update `...-jump-to-note'
org-id used by
- `org-noter-pdftools-convert-old-org-heading'
- `org-noter-pdftools-jump-to-note'
- `org-noter-pdftools-embed-org-note-to-pdf'

image-mode used by
- `org-noter-pdftools--doc-goto-location'
- `org-noter-pdftools--doc-approx-location'
now identical to latest org-pdftools' `org-noter-pdftools.el`

History:
2019-08-04: Original code written by Xi Fu into GC's org-noter.el.
2019-08-23: GC moves code this to current filepath
2020-02-15: Guoqiang Jin brings this file into org-pdftools as
org-noter-pdftools.el

2020-08-03: this is the last of a series of commits re-aligning
org-noter-integration with org-pdftools/org-noter-pdftools.el
other/org-noter-integration.el == org-pdftools/org-noter-pdftools.el
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

Successfully merging this pull request may close these issues.

9 participants