summaryrefslogtreecommitdiff
path: root/lisp/pdf-util.el
AgeCommit message (Collapse)Author
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-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-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 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-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-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)
2020-04-27Fix typosJonas Bernoulli
2019-11-26Fix typosDamien Cassou
Typos found with codespell.
2019-10-07Sanitise temporary directory/file names using `convert-standard-filename'Jordan Wilson
This fixes politza#511.
2019-02-19Support high-resolution displaysNathaniel Nicandro
2019-01-29Add compatibility with Emacs 27Andreas Politz
2018-10-08Improve compatibility of imagemagick's convert with MS WindowsAndreas Politz
2017-09-12Fix missing defcustom typesAndreas Politz
2017-08-20Fixes whitespaceAndreas Politz
2017-03-01Delete trailing whitespaceAndreas Politz
2015-06-20Fix compatibility functionsAndreas Politz
* lisp/pdf-util.el (alist-get, register-read-with-preview): Move aliases out of eval-when-compile.
2015-06-19Fix minor comment issueAndreas Politz
* lisp/pdf-util.el: State correct version.
2015-06-19Define alias for register-read-with-preview if neededAndreas Politz
* lisp/pdf-util.el (register-read-with-preview): Alias to read-char for Emacs not defining it.
2015-06-19Define alist-get if neededAndreas Politz
* lisp/pdf-virtual.el (pdf-util): Require it. * lisp/pdf-outline.el (pdf-util): Require it. * lisp/pdf-util.el (alist-get): Only available in >= 25.1
2015-06-13Use midnight-colors in tooltip.Andreas Politz
* lisp/pdf-util.el (pdf-util-tooltip-arrow):
2015-06-12Added 3 helper function.Andreas Politz
* lisp/pdf-util.el (pdf-util-edges-transform): Transform edges between coordinate systems. (pdf-util-edges-p): Predicate for edges. (pdf-util-remove-duplicates): Faster, stable remove-duplicates.
2015-04-02Added pcre quote function.Andreas Politz
* lisp/pdf-util.el: New function.
2015-03-31Clear face cache after loading a theme.Andreas Politz
* lisp/pdf-util.el: Add an advice for enable-theme.
2015-03-30Added PCRE support.Andreas Politz
* lisp/pdf-info.el (pdf-info-query--transform-response): Put match face properties on the matched text of the line. (pdf-info-search-string): The returned line now contains face properties on the matched part. (pdf-info-search-regexp): This function now searches for PCRE, and as such the calling convention has changed to support the various flags of the underlying engine. (pdf-info-regexp-compile-flags, pdf-info-regexp-match-flags): List of regexp flags. * server/epdfinfo.c: (cmd_search_regexp): Use complex numeric flags of the new engine instead of the old boolean ones. Now returns both the matched text and it's corresponding line. (cmd_search_string): Return both as well. (cmd_regexp_flags): New command returning regexp flags and their values. * lisp/pdf-util.el (pdf-util-highlight-regexp-in-string): New function for propertizing a string. (pdf-util-edges-union): Added minor optimization.
2015-02-12Added a sequence alignment function.Andreas Politz
* lisp/pdf-util.el (pdf-util-seq-alignment): This will be used in the pdf-sync backward search.
2015-02-06Renamed pdf-sync symbols and some cleanup.Andreas Politz
* lisp/pdf-util.el (pdf-util-goto-position): New function. * lisp/pdf-sync.el (pdf-util): Require it. (pdf-sync-tex-display-pdf-key): Renamed as pdf-sync-forward-display-key. Provided aliases for this and the following symbols. (pdf-sync-goto-tex-hook): -> pdf-sync-forward-hook (pdf-sync-display-pdf-hook): -> pdf-sync-backward-hook (pdf-sync-display-pdf-action): -> pdf-sync-forward-display-action (pdf-sync-mouse-goto-tex): -> pdf-sync-backward-search-mouse (pdf-sync-goto-tex): -> pdf-sync-mouse-goto-tex (pdf-sync-correlate-tex): -> pdf-sync-backward-correlate (pdf-sync-display-pdf): -> pdf-sync-forward-search (pdf-sync-correlate-pdf): -> pdf-sync-forward-correlate (pdf-sync-forward-correlate): Use function pdf-util-goto-position. (pdf-sync-backward-display-action): New variable.
2015-02-04Fixed a test-case when running headless.Andreas Politz
* lisp/pdf-util.el (pdf-util-hexcolor): Return the argument unmodified if it is already a valid hexcolor. This avoids problems when running the tests in a frame-less Emacs.
2015-01-11Made Keywords: section standard conform.Andreas Politz
* lisp/*.el: Use standard keywords.
2014-12-06Handle display properties when bookmarking.Andreas Politz
* lisp/pdf-view.el (pdf-view-bookmark-make-record): Store the slice, size and image-origin in the bookmark. (pdf-view-bookmark-jump): Restore above values. * lisp/pdf-util.el (pdf-util-image-displayed-edges): Round the return value. Added a displayed-p argument.
2014-12-06Round scroll values.Andreas Politz
* lisp/pdf-util.el (pdf-util-required-hscroll): Round return value. (pdf-util-required-vscroll): Dito.
2014-12-06Use a variable for saving a function definition.Andreas Politz
* lisp/pdf-util.el: Using defalias is asking for trouble, better use defvar.
2014-12-06Make pdf-tools compatible with Emacs 24.3Andreas Politz
* lisp/pdf-view.el (pdf-view-mode): Set major-mode before setting up winprops. (pdf-view-new-window-function): Check winprops for image. (pdf-view-desired-image-size): Use compatibility macro pdf-util-window-pixel-width. * lisp/pdf-util.el: (pdf-util-window-pixel-width): Compatibility macro for window-width in pixel. (image-mode-winprops): Use implementation from 24.4 if current buffer is in pdf-view-mode. * lisp/pdf-annot.el (pdf-annot-print-annotation-latex): Don't use org-create-formula-image, since it is not available in 24.3. * README.org: Qualify needed Emacs version to be 24.3
2014-12-02Docu fix.Andreas Politz
2014-12-02Add implementation for with-file-modes.Andreas Politz
* lisp/pdf-util.el: Optionally define the macro with-file-modes, if it is not available.
2014-12-02Adjust tooltip arrow.Andreas Politz
* lisp/pdf-util.el (pdf-util-tooltip-arrow): Make the tooltip center display at image-top.
2014-11-26Add missing requiresAndreas Politz
* lisp/pdf-view.el: Require pdf-view. * lisp/pdf-util.el: Declare pdf-cache-pagesize. * lisp/pdf-tools.el: Require pdf-cache.
2014-11-26*** empty log message ***Andreas Politz
2014-11-26*** empty log message ***Andreas Politz
2014-11-24*** empty log message ***Andreas Politz
2014-11-24*** empty log message ***Andreas Politz
2014-11-24*** empty log message ***Andreas Politz
2014-11-23*** empty log message ***Andreas Politz
2014-11-22*** empty log message ***Andreas Politz
2014-11-19*** empty log message ***Andreas Politz
2014-11-18*** empty log message ***Andreas Politz
2014-11-16*** empty log message ***Andreas Politz
2014-11-15*** empty log message ***Andreas Politz
2014-11-14*** empty log message ***Andreas Politz