summaryrefslogtreecommitdiff
path: root/lisp
AgeCommit message (Collapse)Author
2026-01-01chore: bump the version of pdf-tools to 1.3.0v1.3.0Vedang Manerikar
2025-12-31test: add pdf-roll tests and fix defcustom bugVedang Manerikar
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.
2025-12-31feat: integrate pdf-view-roll-minor-mode with existing featuresVedang Manerikar
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>
2025-12-31feat: add pdf-roll.el for continuous scroll supportVedang Manerikar
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>
2025-12-31chore: bump the version of pdf-tools to 1.2.1v1.2.1Vedang Manerikar
2025-12-31fix(pdf-view): replace obsolete registerv-make with cl-defstructVedang Manerikar
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
2025-12-30fix(pdf-view): fix docstring warnings for native-compVedang Manerikar
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
2025-12-30fix(pdf-util): add declare-function for native-comp warningsVedang Manerikar
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
2025-12-30fix(pdf-info): add declare-function for native-comp warningsVedang Manerikar
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
2025-12-30fix(pdf-cache): add declare-function for native-comp warningsVedang Manerikar
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
2025-12-30fix(pdf-virtual): use correct key function for filtering page linksVedang Manerikar
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
2025-12-30chore: release version 1.2.0Vedang Manerikar
Bump version to 1.2.0 and prepare 1.3.0 development cycle.
2025-12-30fix: wrap next-line-or-page, previous-line-or-page boundary calls in ↵Vedang Manerikar
ignore-errors
2025-12-29feat: support pdf-buffer bookmarks in workspace managersRahguzar
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
2025-12-29Add support for Android Emacs using TermuxJohan Widén
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
2025-12-29feat(midnight-mode): add gamma correction and fix RGB bugsZiv Scully
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
2025-12-29feat(pdf-view): enable horizontal mouse wheel scrollingaikrahguzar
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
2025-12-29fix(pdf-annot): refresh stale annotations before operationsbramadams
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
2025-12-29feat(pdf-view): enable scroll-other-window supportKen Huang
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
2025-12-28feat: add option to display page labels in mode lineRafael Beirigo
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
2025-12-28feat: set slice to common bounding box (closes #325)Tamas K. Papp
Fixes #325.
2025-12-28fix: use absolute line number in pdf-syncPhilipp G. Haselwarter
`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.
2025-12-28feat: add pdf-metadata-buffer-modeAidan Hall
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.
2025-12-28fix: use kill-current-buffer (closes #287)Michael Hoffman
Fixes #287.
2024-04-29Fix: scroll by arg lines #249manu
2024-04-11Fix defcustom :type argumentsAaron L. Zeng
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.
2024-04-03[pdf-annot] Fix: remove obsolete annotation-properties variablesVedang Manerikar
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
2024-03-17Fix: create alias for x-gtk-* variables for Emacs >28Vedang Manerikar
The x-gtk prefix has been dropped in Emacs 29.
2024-03-17Fix pdf-loader-install calling pdf-tools-install with wrong argsAaron L. Zeng
2024-03-14Merge pull request #263 from jakanakaevangeli/decrypt-no-fileVedang Manerikar
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
2024-03-14Fixes obsolete outline commands in PDF Outline (#265)Ramon Diaz-Uriarte
Replace obsolete outline commands with their newer versions --------- Authored-by: Ramon Diaz-Uriarte (@rdiaz02)
2024-03-09Support 'revert-buffer' on encrypted documentsMiha Rihtaršič
2024-03-09Don't retry with the same cached password upon decryption failureMiha Rihtaršič
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.
2024-03-08Support decryption of non-file-visiting pdf buffersMiha Rihtaršič
Opening a pdf e-mail attachment from within Emacs can show a pdf-view buffer, where (buffer-file-name) returns nil.
2023-06-11Add display-line-numbers-mode to the list of incompatible modesVedang Manerikar
Somehow, this had been missed.
2023-06-11[v2] Auto enable pdf-view-dark-minor-mode if the theme is darkVedang Manerikar
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!
2023-06-11Fix: Keep cursor on the same line when reopening list of annotsPedro Ribeiro Mendes Júnior
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
2023-06-11Allow creation of markup annotations without a text selectionAugusto Stoffel
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
2023-06-11Use 'C-c C-k' to abandon edits of annotation contentsAugusto Stoffel
This is consistent with other Emacs packages such as org-capture, VC, Magit, etc. Closes: #192
2023-06-11Display a header line when editing annotation contentsAugusto Stoffel
2023-06-11Add command and submenu to switch between selection stylesAugusto Stoffel
Make it possible to set `pdf-view-selection-style` from Easy Menu. Closes: #190
2023-06-10Auto enable pdf-view-dark-minor-mode if the theme is darkVedang Manerikar
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
2023-06-10Bump pdf-tools version to v1.1.0v1.1.0Vedang Manerikar
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
2023-04-04Ensure pixel-scroll-precision-mode deactivationDavide Masserut
Setting `pixel-scroll-precision-mode` to nil is not sufficient to disable the mode locally. Updates: #124
2023-01-17Change the default color inversion to maintain hueVedang Manerikar
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.
2023-01-17Add support for midnight mode with colorZach Kost-Smith
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
2023-01-17Add a dedicated rotation command and keybindingVisuwesh
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
2023-01-17Change the default selection-style to wordVedang Manerikar
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
2023-01-17Ask for a file name on save if buffer provides noneakater
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
2023-01-16Make selection style configurable by introducing a new variablelennonhill
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