| Age | Commit message (Collapse) | Author |
|
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 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
|
|
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
|
|
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
|
|
Relates to: #26
|
|
There are two issues with `revert-buffer` for remote files:
- `revert-buffer` does not update the local temporary copy of the
remote file (`pdf-view--buffer-file-name`). Since
`revert-buffer--default` does in fact renew contents of the current
buffer when visiting a remote file, the fix is the matter of flushing
the buffer contents into the temporary file, exactly how it's done in
`pdf-view-mode`: https://github.com/vedang/pdf-tools/blob/386dca5b2d078ba691eefe230478a440ee1f7b16/lisp/pdf-view.el#L321-L322
- `revert-buffer` relies on `pdf-info-close` to run
`pdf-info-close-document-hook`, which clears the image and data
caches, so they can be rebuilt from the new file. `pdf-info-close`
first normalizes the file using `pdf-info--normalize-file-or-buffer`,
which returns `pdf-view--buffer-file-name`, and then tries to run the
hook in the buffer visiting that file. Since there is not going to be
a buffer visiting the local temporary file (normally), no hooks are
actually ran. Fixed by deriving the buffer directly from the
`file-or-buffer` argument:
```
(cond
((not file-or-buffer) (current-buffer))
((bufferp file-or-buffer) file-or-buffer)
((stringp file-or-buffer) (find-buffer-visiting file-or-buffer)))
```
Closes: #126, #128
|
|
The bug is fixed upstream in Emacs 27 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19016
Fixes: #118
|
|
- 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 reverts commit 8b2debaba240d20ac5f30a9ba076eb532a2396c7, which
was introduced in an attempt to fix #13. I am now tracking this issue
under #19.
@iostapyshyn has confirmed that this change breaks scaling and is not
the correct fix.
|
|
`pdf-view-image-size` passes in the width of the current page to
`pdf-info-renderpage` during an isearch. Use this as-is, instead of
multiplying it with the `pdf-util-frame-scale-factor`.
This is a potential fix for the bug raised by PR #13.
I'm not sure if this was a bug earlier as well, but was masked since
the code-path did not execute for `png` images.
I will treat this as a temporary change until I can better understand
the original reasons behind putting it in. Since I don't have access
to a Mac running `emacs-mac` , I have tested it by hard-coding
`pdf-util-frame-scale-factor` to 2 on my local setup, and everything
seems to be working correctly.
|
|
Typos found with codespell.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Render a empty page. This should expose problems with linked
libraries.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Let the default value of 'pdf-info-epdfinfo-program' automatically
determine if PDF Tools is installed as a Melpa package (where the
epdfinfo binary is in ./build) or as a Git clone (where it's found at
../server/)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* lisp/pdf-info.el (pdf-info-compose-queries): ...
|
|
* lisp/pdf-info.el (pdf-info-charlayout): Let edges-or-pos default to the whole page.
|
|
* lisp/pdf-info.el (pdf-info-normalize-page-range): Remove unused t as allowed page.
|
|
* lisp/pdf-info.el (pdf-info--normalize-file-or-buffer): Use
expand-file-name on the result.
|
|
* lisp/pdf-info.el (pdf-info--normalize-file-or-buffer): Check major-mode once.
|
|
* lisp/pdf-info.el (tq-process-buffer): Use a iterative algorithm,
which may avoid problems with many requests (max eval depth).
|
|
* lisp/pdf-info.el (pdf-info-asynchronous): Allow for arguments to be passed.
(pdf-info-query): Handle them.
|
|
* server/epdfinfo.c (cmd_ping): Pong.
* lisp/pdf-info.el (pdf-info-ping): Handle it.
|
|
* lisp/pdf-tools.el: Add let-alist as requirement.
* lisp/pdf-occur.el (pdf-occur-add-matches, pdf-occur-start-search): Use new interface.
* lisp/pdf-isearch.el (pdf-isearch-search-page): Use new interface.
* lisp/pdf-info.el (pdf-info-query--transform-action,
pdf-info-query--transform-response): Prefer alists over trees or
positional lists, where appropriate.
(pdf-info-search-string,pdf-info-search-regexp,pdf-info-pagelinks
pdf-info-charlayout,pdf-info-pagelinks, pdf-info-outline,
pdf-info-synctex-forward-search, pdf-info-synctex-backward-search):
Updated documentation.
* test/pdf-info.ert: Require let-alist, use new interface.
* Makefile (bytecompile, test): Use cask.
* Cask (depends-on): Add let-alist.
* lisp/pdf-outline.el: Use new interface.
* lisp/pdf-links.el: Use new interface.
* lisp/pdf-cache.el: Use new interface.
* lisp/pdf-sync.el: Use new interface.
|
|
* server/epdfinfo.c (cmd_renderpage): Incorporated cmd_renderpage_x
commands into cmd_renderpage.
* lisp/pdf-view.el (pdf-view-extract-region-image): Use new rendering capabilities.
* lisp/pdf-info.el (pdf-info-renderpage): Adhere to and provide new command protocol.
(pdf-info-renderpage-text-regions): Use pdf-info-renderpage.
(pdf-info-renderpage-highlight): Use pdf-info-renderpage.
|
|
Recolor
|
|
* lisp/pdf-info.el (pdf-info-check-epdfinfo): Let default-directory be ~.
(pdf-info-process-assert-running): Ditto.
|
|
Conflicts:
lisp/pdf-info.el
server/epdfinfo.c
server/epdfinfo.h
|