| Age | Commit message (Collapse) | Author |
|
Update all pdf-tools features to work correctly when
pdf-view-roll-minor-mode is active:
- pdf-isearch: Search across all displayed pages simultaneously
- pdf-links: Link selection works with multiple visible pages
- pdf-annot: Annotations work on correct page, add pdf-annot-edit
command for avy-style annotation editing
- pdf-sync: SyncTeX jumps work with continuous scroll mode
- pdf-view: Display and navigation functions updated for multi-page
- pdf-util: Coordinate transformation updates for visible pages
- pdf-cache: Simplify prefetch (remove timer indirection)
- pdf-occur: Minor compatibility updates
The mode is experimental. Some features may not interact perfectly
with roll mode. Enable with M-x pdf-view-roll-minor-mode.
API changes:
- pdf-view-active-region now includes page information
- isearch results include page data for multi-page display
Co-authored-by: Daniel Nicolai <dalanicolai@gmail.com>
Co-authored-by: Rahguzar <aikrahguzar@zohomail.eu>
Co-authored-by: Ihor Radchenko <yantar92@gmail.com>
Co-authored-by: NightMachinery <feraidoonmehri@gmail.com>
|
|
Fix "epdfinfo: No such annotation: annot-X-Y" error caused by
annotations getting out-of-sync between buffer and epdfinfo cache.
Add pdf-annot--ensure-fresh function that fetches fresh annotation data
from the server before modifying, deleting, or interacting with annotations.
Fixes: #246
Closes: #260
Author: @bramadams
|
|
Replace `pdf-annot-default-markup-annotation-properties` and
`pdf-annot-default-text-annotation-properties` with the newer
`pdf-annot-default-annotation-properties`, and remove their use in
`pdf-annot-merge-alists`.
As a side-effect, this fixes broken functionality when providing
defaults for reading colors.
Closes: #268
|
|
The x-gtk prefix has been dropped in Emacs 29.
|
|
Check if the buffer of the list of annotations already exists. In that
case, avoid calling `tabulated-list-print` because the call to that
function makes the cursor move to the beginning of the buffer.
Tested for:
- the buffer of the list of annotations already exists;
- a new note is created;
- that buffer is reopened with the cursor on the same position as
previous left;
and the newly inserted note appears as expected.
Closes: #211
|
|
This allows calling `pdf-info-addannot` from Lisp with a nil
`markup-edges` argument, which was previously disallowed.
In this case, the annotation covers exactly the selected region of the
page, without attempting to match it to a certain text region.
This means that you can now highlight an exact region! Just select the
region by holding down the Meta key and dragging the mouse. Then
invoke `pdf-annot-add-highlight-markup-annotation` (with `C-c C-a h`)
and voila!
Closes: #191
|
|
This is consistent with other Emacs packages such as org-capture, VC,
Magit, etc.
Closes: #192
|
|
|
|
Make selection-style configurable via `pdf-view-selection-style`. A
default value of `word` might be desirable, as selection is usually
intended to select entire words is perceptually faster than
glyph-based selection.
This affects selections and highlights, but not search.
Limitation:
The selection type is fixed for all currently selected regions.
Selecting multiple regions with different selection styles at the same
time would require storing the selection style for every region and
replacing the protocol for `cmd_addannot` with a more flexible one,
e.g. the keyword-based one used by `cmd_renderpage`.
Closes: #73
|
|
Free-text annotations do not have a color associated with them, which
causes annotation listing to crash (since the default value of
`pdf-annot-list-highlight-type` is now true). This bug was introduced
in bb0b71f5bafd81d0b5647c4ec48fafa0bb6f6c21
|
|
The `cl-ecase` macro does not support default cases (‘otherwise’ or
‘t’), and the cl-case macro requires the default case to be the last
clause, which a recent change to Emacs rendered a macro expansion
error[^1], thus preventing the module from loading (and potentially
signalling error in the init process).
Furthermore, `cl-ecase` expands to a `cl-case` form with a trailing
special flag clause, so the appearance of a ‘t’ or ‘otherwise’ clause
in a `cl-ecase` call will always result in this error being triggered.
I thus replace the apparently futile call to `cl-ecase` with an
equivalent null check and a call to `cl-case`, which fixes both issues.
I replaced `cl-ecase` with `cl-case` because the former form had both a
t-check and a nil-check, which meant the error case was impossible to
be triggered.
[^1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51368
Closes: #159
Closes: #154
Closes: #157
|
|
Fix warnings and remove code for supporting older versions of Emacs
from the following files:
1. `pdf-annot.el`
Relates to: #26
|
|
Use color when listing annotations by default, and allow users to turn
it off if required (switching the default boolean value)
|
|
Previously, the `date` field was sorted alphabetically, instead of
according to date.
Changes:
* lisp/pdf-annot.el (pdf-annot--make-entry-formatter): Propertize
string to include the lisp date.
(pdf-annot-list-mode): Add function to sort date.
Notes:
- Why use `propertize` instead of parsing the string back?
+ Because there are annotations with no associated dates. In this
case, we display the string "No date". Our parsing code would have
to handle that, `propertize` is just simpler and covers all edge-cases
correctly.
- What can we do better?
+ Currently, the index of the field we are looking up is hard-coded.
So any change in the fields will impact this code silently. We need
to add tests to ensure this is caught.
Closes: #75
|
|
This makes it simpler / more Emacs-y to take notes in annotations that
can then be exported.
|
|
The correct possessive with it is "its", not "it's".
Closes: politza#689
|
|
Users might have changed `org-preview-latex-default-process` from it's
default of value 'dvipng. However, `pdf-tools` can only work with png
files, so bind it locally to ensure that `pdf-tools` can do the right
thing.
Author: Visuwesh <visuwesh@tutanota.com>
Squashed Commit. Closes: #58
|
|
- Add / Fix docstrings for functions.
- Make punctuation changes as suggested by `checkdoc`
This commit makes changes in a subset of files of `pdf-tools`. Some of
the major files are still pending changes, and will be addressed in a
later commit.
Partially Fixes: #64
|
|
- Remove :group arguments from `defcustom` declarations
- `defcustom` picks up `defgroup` names from the same file, so
specifying the group is not necessary
- Ensure that all function-names are properly quoted using #'
- Add an explicit header-option setting lexical-binding to t
- Ensure that cl-check-type uses `satisfies` for filenames
- Replace all `defadvice` with `advice-add`
- Replace `(list ...)` patterns with `\`(...)` patterns
Fixes: #62
Fixes: #32
Partially Fixes: #24
|
|
This removes the positial arguemnt triplet from the define-minor-mode
calls, because they are obsolete since Emacs<21. See the following
paragraph in the help section of define-minor-mode.
For backward compatibility with the Emacs<21 calling convention, the
keywords of define-minor-mode can also be preceded by the obsolete
triplet INIT-VALUE LIGHTER KEYMAP.
|
|
This is to avoid repeatedly scaling the displayed image width when
applying highlighting. Fixes #19. Closes #22.
As it turns out, it wasn't only `isearch` and `occur` which were
broken, but everything that includes highlighting: selection and jump
to annotation (`C-c C-a l SPC`) as well.
The behavior was caused by passing the value of
`(pdf-view-image-size)` into the highlight functions
(`pdf-info-renderpage-text-regions` and
`pdf-info-renderpage-highlight`) and using the result as it is,
without re-adjusting the displayed image width as it's done when
displaying raw pages without any highlighted elements, see [this
line](https://github.com/vedang/pdf-tools/blob/df2eea87aa84711024b48b2184b1c1ca1b2d0e7b/lisp/pdf-view.el#L935)
This caused the image width to be multiplied with the
`frame-scale-factor` in `pdf-info-renderpage` and the width of the
returned raw image to be interpreted by `create-image` as the
requested width of the image as seen in the buffer.
Fixed by passing the width explicitly in every call to
`pdf-view-create-image`, except for [this
one](https://github.com/vedang/pdf-tools/blob/df2eea87aa84711024b48b2184b1c1ca1b2d0e7b/lisp/pdf-annot.el#L1365),
which seems to be responsible for latex fragment rendering.
|
|
|
|
|
|
There are places with code similar to the following:
(save-selected-window
(select-window window)
…)
For the purposes of this commit, this is roughly equivalent to:
(let ((old-window (selected-window)))
(select-window window)
…
(select-window old-window 'norecord))
That is, when ‘save-selected-window’ restores the state, it passes
‘norecord’ argument to ‘select-window’ function. As a result, when
selected window is initially changed ‘buffer-list-update-hook’ is
called however it is not invoked when selected window is restored.
This confuses any code using that hook to track selected window.
To address this issue, change calls such as the above to use
‘norecord’ argument. This way, ‘buffer-list-update-hook’ is called
neither when the new window is temporarily selected nor when old
window is restored.
For reference, this is indeed what documentation of ‘select-window’
says should be done:
> Run ‘buffer-list-update-hook’ unless NORECORD is non-nil. Note that
> applications […] often select a window temporarily […] to simplify
> coding. As a rule, such selections should not be recorded and
> therefore will not pollute ‘buffer-list-update-hook’. Selections
> that "really count" are those causing a visible change in the next
> redisplay of WINDOW’s frame and should always be recorded.
Fixes: https://github.com/mina86/auto-dim-other-buffers.el/issues/26
|
|
|
|
|
|
|
|
Customizable annotation list format
|
|
|
|
|
|
|
|
Introduces `pdf-annot-list-highlight-type', which when enabled highlights the
"type" column in the annotation list with the color of the annotation.
|
|
Introduces a new customization variable, `pdf-annot-list-format', which is an
alist of columns and associated widths that should appear in the annotation
list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* lisp/pdf-annot.el (pdf-annot-add-markup-annotation): Use unscaled values for edges.
|
|
* server/epdfinfo.c (cmd_renderpage_highlight): Properly handle the
arguments.
* lisp/pdf-info.el (pdf-info-renderpage-highlight): Likewise.
* lisp/pdf-annot.el (pdf-annot-show-annotation): Use slightly better
looking colors.
|
|
* lisp/pdf-annot.el (pdf-annot-add-markup-annotation): Use "#ffff00"
fall back color.
|
|
* lisp/pdf-annot.el (pdf-annot-add-markup-annotation): Fallback to red
as a last resort.
|
|
* lisp/pdf-annot.el (pdf-annot-minor-mode): Manually add the variable
to savehist's variables. Otherwise it may never happen, if the user
uses solely mouse commands.
|
|
* lisp/pdf-annot.el (pdf-annot-print-annotation-latex): Call the org
code in a temp buffer, to avoid errors with the read-only PDF
buffer.
|