summaryrefslogtreecommitdiff
path: root/lisp
AgeCommit message (Collapse)Author
2022-01-07Fix: check-doc warnings in pdf-miscdevVedang Manerikar
Relates to: #64
2022-01-07fix: parameter to pdf-misc-popup-context-menuShuguang Sun
A parameter `event' is required at least for emacs 29.0. Add `_event' to pacitify compiling warning.
2022-01-03Minor language correction: it's -> itsVedang Manerikar
The correct possessive with it is "its", not "it's". Closes: politza#689
2022-01-02Update version and mark it as 1.0.0snapshotVedang Manerikar
NonGNU ELPA updates based on the package version number. Unfortunately, 1.0.0snapshot is considered older than 1.0, so I don't expect this to update anything in NonGNU ELPA, but it is a step in the right direction.
2022-01-02Ensure usage of 'dvipng in `pdf-annot-print-annotation-latex`Vedang Manerikar
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
2021-12-31Use `l` and `r` for backward / forward in history.Vedang Manerikar
`l` and `r` are the conventional bindings for history navigation. The previous key-bindings `B` and `N` are kept as-is for people who were used to it. This is a breaking change because `r` was previously bound to `revert-buffer`. However, `g` is also bound to `revert-buffer` and is the conventional binding for `revert` so this should be okay. Fixes: #43
2021-12-31Reset slice when auto-slice is turned offVedang Manerikar
When `pdf-view-auto-slice-minor-mode` is turned off, remove slicing and re-display the window. Fixes: #44
2021-12-31Fix checkdoc errors in pdf-tools lisp codeVedang Manerikar
- 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
2021-12-31Indentation and code-quality fixesVedang Manerikar
- 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
2021-11-10Adapt Emacs' easy-menu change #50Shuguang Sun
Emacs had made some change to the easy-menu system, that is, `easy-menu-define` lowers the menu-bar key automatically. Ref: https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-09/msg02038.html Closes #50 Signed-off-by: Shuguang Sun <shuguang79@qq.com>
2021-11-10Use theme background for tooltip arrowJunyuanChen
If `pdf-view-themed-minor-mode' is active, use theme background for tooltip arrow (background) instead of white.
2021-10-04Sanitize buffer name for use as temp file prefixRoshan Shariff
Prefixes for temporary files are derived from either the file name associated with the pdf-view buffer, or the buffer name if it is not visiting a file. If the buffer name contains '/' characters, then it is not a valid file name. Clean up non-alphanumeric characters in the buffer name before using it as a temp file prefix.
2021-05-31define-minor-mode: Remove support for obsolete pos argumentsThomas Hisch
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.
2021-05-31Explicitly pass width through `pdf-view-create-image`Illia Ostapyshyn
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.
2021-05-30Update the README to mention that GNU/Linux is the supported OS.Vedang Manerikar
Closes #21
2021-05-30Revert "`pdf-info-renderpage`: Use the width of the page as passed in."Vedang Manerikar
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.
2021-05-30`pdf-info-renderpage`: Use the width of the page as passed in.Vedang Manerikar
`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.
2021-05-29Support HiDPI displays on vanilla emacsIllia Ostapyshyn
Fixes the long-standing issue of displaying pdf contents in proper resolution on retina Macs using vanilla (not a fork) emacs [1], [2] This commit squashes changes contributed by @iostapyshyn. It introduces the following changes: - Use `frame-scale-factor` to detect HiDPI displays in preference to other methods. `frame-scale-factor` is a new function introduced in Vanilla Emacs to return the scale factor of the backing store. - Allow scaling for `png` type images as well (if `pdf-view-use-scaling` is `t`), since this works well and I'm not sure why it was originally disabled. 1: politza/pdf-tools#51 2: hlissner/doom-emacs#4989 Closes #13
2021-05-11Fix: minor issues as found by package-lint and checkdocVedang Manerikar
2021-05-11Fix reference to free variable warning for image-mode-winprops-alist (#9)Utkarsh Singh
Fixes the following compilation warnings: Warning (comp): pdf-util.el:113:36: Warning: reference to free variable ‘image-mode-winprops-alist’ Warning (comp): pdf-util.el:114:39: Warning: assignment to free variable ‘image-mode-winprops-alist’
2021-03-07Add option to customize fill-column in pdf outlinesMatt Huszagh
This commit gives the user the option to disable the action of `fill-column` (or customize it to whatever they want) in pdf-outline buffers. This is useful because outlines frequently contain long lines, and breaking up the lines destroys the formatting and integrity of the outline. Closes politza/pdf-tools#602, politza/pdf-tools#593
2021-02-27Fix: remove deprecation warning for org-open-link-from-stringVedang Manerikar
2021-02-21Add pdf-view navigation remapsWill Dey
Modes like evil or xah-fly-keys don’t always use C-n/C-p for navigation, so adding remapping bindings like `[remap next-line]` to the `pdf-view-mode-map` will let PDF Tools work as expected no matter what keys the user usually has bound to next-line/previous-line. Some other entries in the map already use key remapping for things like `goto-line`, so this PR just adds some more common remaps to keep a consistent user experience. Also, re-aligned the commands with whitespace since some of the new names messed up the old alignment
2021-02-21Add pdf-virtual-global-minor-mode to pdf-tools custom groupJonas Bernoulli
2021-02-21Fix typosJonas Bernoulli
2021-02-21Remove declare-function calls for macros moved to pdf-macs.elVedang Manerikar
We are now directly requiring these macros from pdf-macs.el, so we should not be using `declare-function` anymore. Closes politza/pdf-tools#626, politza/pdf-tools#625
2021-02-21Factor out macros to ensure they're visible in pdf-cache.elAndrew Whatson
2021-02-21Fix: indentation of code in pdf-view-themed-minor-modeVedang Manerikar
Also, use `pdf-util-assert-pdf-buffer` instead of `pdf-tools-assert-pdf-buffer`.
2021-02-21Add themed colour modeNathanael Gentry
Note that this mode does not keep updated with theme changes; it only applies the colors of the current theme. Hook into `enable-theme` and `disable-theme` for that.
2021-02-20Fix typos and rename variables around printing PDFsVedang Manerikar
Extends the work done in 2ece508 and 91630c2 to ensure that typos are correctly fixed. Also renames the custom variable `pdf-misc-print-program` to `pdf-misc-print-program-executable` to avoid confusion with the function of the same name.
2021-02-20Update pdf-misc.elStephen Eglen
I think this typo was missed.
2021-02-20Fixing breaking change in emacs27 image-modeTyler Ware
In emacs27 `image-set-window-vscroll` changed from taking lines to taking pixels. This has introduced a bug with usages of `pdf-util-required-vscroll`, which returns lines. Usages of that function are calling `image-set-window-vscroll`, so this change is to move `pdf-util-required-vscroll` to using pixels as well (only for <=emacs27)
2021-02-20Don’t record temporary window selection changesMichal Nazarewicz
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
2020-05-12'set-window-hscroll does not update image-mode hscrollTyler Ware
image-mode keeps it's own copy of hscroll and during redisplay it will grab that value and use it. If you don't update image-mode's hscroll, but directly set the window's hscroll you will (after triggering a redisplay) find your pdf scrolled all the way to the left margin. Quite unfortunate if you happen to be zoomed in. This fixes that by using image-mode's method for updating hscroll
2020-04-27Fix typosJonas Bernoulli
2020-02-14Fix case-folding when starting occur from isearchAndreas Politz
2019-11-26Fix typosDamien Cassou
Typos found with codespell.
2019-10-31Adopt to recent changes in EmacsAndreas Politz
Introduces a variable pdf-view-have-image-mode-pixel-vscroll which should be non-nil, if image-mode scrolls vertically pixel-wise.
2019-10-07Sanitise temporary directory/file names using `convert-standard-filename'Jordan Wilson
This fixes politza#511.
2019-07-01Remember to redisplay pages which were changed while hiddenAndreas Politz
2019-06-28Avoid running hooks in a not yet completely set up bufferAndreas Politz
2019-04-13Bump tablist version requirementAndreas Politz
2019-04-13Merge pull request #483 from andersjohansson/current-pagelabelpolitza
Adds a function for returning the label of the current page
2019-04-12Fix definition of pdf-cache-prefetch-minor-mode keymapAaron L. Zeng
`t` is not a valid keymap. I looked through the other minor-mode definitions and didn't see any other such uses. Found that this was causing me problems, see Wilfred/helpful#114.
2019-03-27Add function for returning current page labelAnders Johansson
2019-03-08Don't go to initial page when activating `pdf-view-mode`Nathaniel Nicandro
This fixes an issue where the page of a PDF being shown in the `selected-window` would be reset if the PDF was different than the PDF of the `current-buffer`.
2019-02-20Add the ability to specify which installer to useMohammed Yaseen Mowzer
This is useful when you have two installers on the same machine (e.g. pacman and nix-shell) and you want to choose between one of them.
2019-02-19Add NEWS entry, expand documentation.Andreas Politz
2019-02-19Set :data-2x key as an image property on supported systemsNathaniel Nicandro
2019-02-19Support high-resolution displaysNathaniel Nicandro