| Age | Commit message (Collapse) | Author |
|
|
|
Add automated tests for pdf-roll functionality:
- pdf-roll-page-to-pos utility function
- pdf-roll-page-at-current-pos with various positions
- Customization defaults
- Symbol properties
- Minor mode keymap existence
Fix bug in pdf-roll-margin-color defcustom where the :set
function didn't actually set the variable value.
|
|
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>
|
|
Add core infrastructure for displaying multiple PDF pages
simultaneously with continuous scrolling. This introduces
pdf-view-roll-minor-mode which can be enabled in any PDF buffer.
The implementation is based on image-roll.el by Daniel Nicolai,
with significant enhancements by Rahguzar for pdf-tools integration.
Key features:
- Smooth pixel-level scrolling across page boundaries
- Multiple pages visible simultaneously
- Integration with pixel-scroll-precision-mode
- Efficient page display/undisplay management
Closes #18, #104
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>
|
|
|
|
The registerv-make function was deprecated in Emacs 27.1. Replace it
with a proper cl-defstruct (pdf-view-register) and cl-defmethod
implementations for register-val-jump-to, register-val-describe,
and register-val-insert.
Add tests for the register API used by pdf-view:
- pdf-view-registerv-make-creates-register: verifies register creation
- pdf-view-register-val-insert: verifies insert method works
- pdf-view-position-to-register-stores-position: verifies store/retrieve
Fixes: #333
|
|
Reformat docstrings in pdf-view--bounding-box-to-slice,
pdf-document-common-bounding-box, and pdf-view-set-slice-common-bounding-box
to be under 80 characters wide and use proper quoting conventions.
Ref #333
|
|
Add declare-function statements for image-mode-window-get,
image-set-window-vscroll, and image-set-window-hscroll to silence
native compilation warnings about image-mode functions.
Ref #333
|
|
Add declare-function statements for pdf-util-frame-scale-factor,
pdf-util-hexcolor, pdf-util-munch-file, pdf-util-highlight-regexp-in-string,
and pdf-view-buffer-file-name to silence native compilation warnings.
Ref #333
|
|
Add declare-function statements for pdf-view-desired-image-size,
pdf-view-create-page, and image-mode-window-get to silence native
compilation warnings about functions not known to be defined.
Ref #333
|
|
The pdf-virtual-pagelinks function was passing 'car as the key function
to pdf-virtual--filter-edges, which caused a type error when processing
links in cropped virtual PDF pages. The link structure is an alist, so
the correct key function extracts edges via (cdr (assq 'edges link)).
Fixes #327
|
|
Bump version to 1.2.0 and prepare 1.3.0 development cycle.
|
|
ignore-errors
|
|
Don't assume that there is a window displaying the buffer when
`bookmark-jump` is called. Instead of `bookmark-after-jump-hook` use
`window-buffer-change-functions` so that the buffer is actually
displayed when the code assuming a window is run.
If `window-buffer-change-functions` isn't bound fallback to
`bookmark-after-jump-hook`. The window argument for the inserted hook
is optional to accommodate both cases.
Use `window-buffer-change-functions` only if buffer has not window.
Save the same bookmark if it wasn't restored
Closes: #188
Author: @aikrahguzar
|
|
Notes from the original PR:
The dependencies for android in autobuild can not be installed in
pdf-tools-install, they have to be installed manually in Termux. But
the dependencies are checked when running autobuild.
pdf-tools-install successfully installs epdfinfo in Android Emacs. One
can then view pdf files.
The shebang in autobuild does not work in Termux, I therefore had to
create a separate script "autobuild.android" that in turn executes
autobuild. The problem with the shebang is that "env" in Termux is not
located at "/usr/bin/env".
pdf-tools/Makefile does currently not work in Android Emacs, but it is
not needed for running pdf-tools-install. Fixing this will have to be
done in a separate pull request, if deemed necessary. Reason: There is
yet no consensus for how to implement a command line emacs, to be run
in batch mode, in Android Emacs.
I have successfully run "make test" in Ubuntu, in the repo feature
branch. Running "make server-test" in the master branch fails, so I
have not tested this in the feature branch.
Closes: #230
Author: @johanwiden
|
|
Add gamma correction options for better contrast control in midnight mode:
- pdf-view-midnight-gamma: nonlinearly scale lightness (default 1.0)
- pdf-view-midnight-gamma-before-invert: control gamma application order
Bug fixes:
- Fix RGB normalization (255 not 256) - was causing incorrect background color
- Add missing black→foreground fast path (comment existed but code was missing)
Closes: #329
Author: @vizziv
|
|
Add support for horizontal scrolling using mouse wheel by setting
mwheel-scroll-left/right-function to image-mode's scroll functions.
Includes boundp checks for compatibility with older Emacs versions.
Closes: #234
Author: @aikrahguzar
|
|
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
|
|
Add remappings for scroll-up-command and scroll-down-command so that
scroll-other-window and scroll-other-window-down work with pdf-view buffers.
This addresses a commonly requested feature:
- https://github.com/politza/pdf-tools/issues/55
- https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg01416.html
- https://www.reddit.com/r/emacs/comments/10pkhko/
Closes: #280
Author: @whatacold
|
|
Add two new customization options:
- `pdf-view-mode-line-position-prefix`: customize the page prefix (default: "P")
- `pdf-view-mode-line-position-use-labels`: show page labels instead of numbers
When enabled, displays PDF page labels (Roman numerals, section
numbers, etc.) in the mode line with safe fallback to numeric pages.
Closes: #331
Author: @rafaelbeirigo
|
|
Fixes #325.
|
|
`line-number-at-pos` should be called with second argument `absolute` set to `t` in order for `pdf-sync-forward-correlate` to work in buffers with active narrowing.
|
|
This makes the metadata buffer consistent with the annotations and
outline buffer in having its own major mode, derived from
special-mode.
I mainly created this because it bugged me that I couldn't press q to
close the metadata buffer.
|
|
Fixes #287.
|
|
|
|
These variables' default values should match the :type given in their
definitions, or else M-x customize will display a warning or may even
fail to initialize properly.
|
|
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.
|
|
|
|
Improvements to PDF decryption:
- Support decryption of non-file-visiting pdf buffers, for example, when opening a pdf e-mail attachment from within Emacs
- Don't retry with the same cached password upon decryption failure, to support re-opening a pdf file with a modified password
- Don't error during 'revert-buffer' on encrypted documents
|
|
Replace obsolete outline commands with their newer versions
---------
Authored-by: Ramon Diaz-Uriarte (@rdiaz02)
|
|
|
|
Password cache may contain a stale password if a pdf file's password is
modified. Re-read a new password without cache in this case, rather than retry
with the same cached password 3 times and fail.
|
|
Opening a pdf e-mail attachment from within Emacs can show a pdf-view buffer,
where (buffer-file-name) returns nil.
|
|
Somehow, this had been missed.
|
|
The first attempt at this workaround was
c451c0e3db5b367d191bddf428e38fd8a21c0102 , which did not work
because (my guess) `pdf-tools-enabled-modes` would be evaluated before
the theme was loaded. This is attempt 2, which sets this value in the
`pdf-view-mode` function itself.
This is meant as a workaround for #166 (which see).
Best guess about what is happening and why this workaround works comes
from @d8660091 (lightly edited):
> I'm using M2 and I can reproduce the issue with just the following
> snippets I extracted from pdf-isearch-current-colors, which was
> invoked during a pdf isearch:
(add-hook 'pdf-tools-enabled-hook
(lambda ()
(pdf-util-face-colors 'pdf-isearch-match nil)
(pdf-util-face-colors 'pdf-isearch-lazy nil)))
> And run `pdf-tools-install`
> I tried adding `(sit-for 1)` before `(delete-frame f)`, the crash
> was gone.
> But I am still not sure what's really happening.
> I think `pdf-view-dark-minor-mode` works because new frame is not
> created and `delete-frame` doesn't happen.
If anyone has an idea about what is happening here and what the
correct way to fix it is, please get in touch via the linked issue!
|
|
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 it possible to set `pdf-view-selection-style` from Easy Menu.
Closes: #190
|
|
This is meant as a workaround for #166 (which see).
Best guess about what is happening and why this workaround works comes
from @d8660091 (lightly edited):
> I'm using M2 and I can reproduce the issue with just the following
> snippets I extracted from pdf-isearch-current-colors, which was
> invoked during a pdf isearch:
(add-hook 'pdf-tools-enabled-hook
(lambda ()
(pdf-util-face-colors 'pdf-isearch-match nil)
(pdf-util-face-colors 'pdf-isearch-lazy nil)))
> And run `pdf-tools-install`
> I tried adding `(sit-for 1)` before `(delete-frame f)`, the crash
> was gone.
> But I am still not sure what's really happening.
> I think `pdf-view-dark-minor-mode` works because new frame is not
> created and `delete-frame` doesn't happen.
If anyone has an idea about what is happening here and what the
correct way to fix it is, please get in touch via the linked issue!
Closes: #166
|
|
This is necessary because the extensive changes in `epdfinfo` do not
get picked up by third party package management systems unless they
enter Melpa Stable.
This mismatch caused a number of issues, which I expect this bump will
now fix. Thanks to @cyrilarnould and @barslmn for pointing this out.
I am also using this bump to close long-open install issues. The idea
here is that these issues are being lost. I would rather everyone
upgrade to the latest versions of `pdf-tools` and `epdfinfo` and then
re-report the issues if they still exist.
Please note: as of this release, users are not expected to manually
set anything on their machines during installation. (for example:
`$PKG_CONFIG_PATH`). The installation should *just work*. If it does
not, please open a ticket so that we can track it.
Fixes: #213
Closes: #177
Closes: #216
|
|
Setting `pixel-scroll-precision-mode` to nil is not sufficient to disable
the mode locally.
Updates: #124
|
|
This commit enables @smithzvk's work in #69 as the default in
`pdf-tools`. It works well for all the PDFs I have tested with.
The previous behaviour can be enabled by setting
`pdf-view-midnight-invert` to `nil`, if required.
|
|
This inversion method attempts to maintain the color hue and saturation but
inverts the lightness using the OKLab color space[^1].
[^1]: https://bottosson.github.io/posts/oklab/
* server/epdfinfo.c (image-recolor): Add feature to support the OKLab
inversion method functionality
* lisp/pdf-view.el (pdf-view-midnight-invert): Add new variable to
invert the image color lightness while maintaining hue.
(pdf-view-midnight-minor-mode): Account for above.
* lisp/pdf-info.el (pdf-info-query--parse-response): Handle changes to
:render/usecolors command
Closes: #69
Closes: #169
Closes: politza/pdf-tools#698
Closes: politza/pdf-tools#608
|
|
We need a dedicated command for rotation since when `pdf-tools`
redisplays the image, the `:rotation` image-property is lost.
Pdf-tools redisplays the images when changing pages, zooming in/out,
setting the slice, etc. so this is essential to have.
A variable is used simply because `pdf-tools` already uses a variable to
keep track of the current scaling.
* lisp/pdf-view.el (pdf-view--current-rotation): Add new variable to
keep track of angle.
(pdf-view-create-page): Account for above.
(pdf-view-mode-map): Add the new command under "R".
(pdf-view-rotate): Add new command.
Fixes: #152
Closes: #165
|
|
Thanks to the stellar work by @hrdl-github in #73, we can now change
the default unit of selection from `glyph` to `word`. This speeds up
selection significantly.
Look at the documentation of `pdf-view-selection-style` for more
information.
Closes: #87
|
|
When visiting a PDF file downloaded by `eww`, `buffer-file-name` returns
nil so the file can't be saved. In such a case, we should ask the user
for a file name instead of failing the operation.
Closes: #178
|
|
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
|