summaryrefslogtreecommitdiff
path: root/lisp/pdf-sync.el
AgeCommit message (Collapse)Author
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-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.
2022-10-03Address some byte-compiler warningsVedang Manerikar
* lisp/pdf-annot.el (pdf-annot-run-modified-hooks): Use cl-case instead of cl-ecase, as the latter does not support t/otherwise clauses. Remove nil clause which never matches. See https://bugs.gnu.org/51368. (pdf-annot-edit-contents-finalize): * lisp/pdf-sync.el (pdf-sync-minor-mode): Mark up symbols `like-this', to avoid having the apostrophe interpreted as a closing single quote. Remove redundant backslashes. (pdf-sync-synctex-file-name): Use line-beginning-position in place of point-at-bol, which is deprecated in Emacs 29. * lisp/pdf-util.el: Autoload list-colors-duplicates before its use in pdf-util-color-completions, as facemenu is not preloaded since Emacs 28. (pdf-util-hexcolor): Use ash in place of lsh, which is deprecated in Emacs 29. (pdf-util-convert): Fix docstring markup and indentation. * lisp/pdf-virtual.el (pdf-virtual-define-adapter): Refill generated docstring to avoid exceeding 80 column warning threshold. Relates to: #26 Relates to: #80 Closes: #150
2022-01-03Minor language correction: it's -> itsVedang Manerikar
The correct possessive with it is "its", not "it's". Closes: politza#689
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-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.
2020-04-27Fix typosJonas Bernoulli
2019-01-29Remove obsolete variablesAndreas Politz
2019-01-23Obsolete pdf-sync-forward-display-pdf-keyAndreas Politz
Bound in Auctex's to C-c C-v if TeX-source-correlate-mode is active.
2018-09-25Silence reading of the synctex.gz fileAndreas Politz
2017-09-12Fix missing defcustom typesAndreas Politz
2017-09-06Makes forward-correlate fail lessAndreas Politz
Just return the PDF file, if the destination could not be found.
2017-09-06Removes defensive programming in pdf-sync.elAndreas Politz
2017-03-01Delete trailing whitespaceAndreas Politz
2016-10-18Fix some spelling errorsBrady Trainor
2015-06-11Simplify pdf-info interface.Andreas Politz
* 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.
2015-02-17Better handle whitespace.Andreas Politz
* lisp/pdf-sync.el (pdf-sync-backward--tokenize): Skip whitespace if necessary.
2015-02-13Implemented a heuristic backward search.Andreas Politz
* lisp/pdf-sync.el: (pdf-sync-backward-hook): Added hook as option for word-wise searching. (pdf-sync-minor-mode-map): Add seemingly standard binding C-mouse1 for backward searches. (pdf-sync-backward-use-heuristic): New variable. If this is non-nil the backward search uses a heuristic which will in most cases locate the character position. (pdf-sync-backward-text-translations): New variable describing a mapping between utf8 character and latex macros. (pdf-sync-backward-text-flush-regexp): Regexp for deleting unhelpfull character from the PDF's text when backward-searching. (pdf-sync-backward-source-flush-regexp): Regexp for deleting unhelpfull LaTeX fragments when backward-searching. (pdf-sync-backward-search): Use the heuristic. (pdf-sync-backward-correlate): Now returns a function (instead of line, column), which when called will move to the correct position. (pdf-sync-backward--find-position pdf-sync-backward--get-source-context, pdf-sync-backward--source-strip-comments, pdf-sync-backward--get-text-context, pdf-sync-backward--tokenize): New functions for the heuristic backward search. (pdf-sync-backward-debug-minor-mode, pdf-sync-backward-debug-wrapper, pdf-sync-backward-debug-explain): Debug functions.
2015-02-10Clear up the hook mess.Andreas Politz
* lisp/pdf-sync.el (pdf-sync-forward-hook, pdf-sync-backward-hook): Put the correct documentation and call the correct hooks.
2015-02-08Drop obsolete function usage.Andreas Politz
* lisp/pdf-sync.el (pdf-sync-forward-search): Use pdf-sync-forward-correlate. * lisp/pdf-misc.el (pdf-sync-mouse-goto-tex): Use pdf-sync-backward-search-mouse.
2015-02-07Fixed an error.Andreas Politz
* lisp/pdf-sync.el (pdf-sync-backward-correlate): Use apply when running pdf-sync-backward-redirect-functions.
2015-02-06Make it possible to redirect forward searches.Andreas Politz
* lisp/pdf-sync.el (pdf-sync-backward-redirect-functions): New hook. (pdf-sync-backward-correlate): Transform the result of pdf-info-synctex-backward-search via the above hook.
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-01-13Fix compile errors and warnings.v0.40Andreas Politz
* lisp/pdf-sync.el (pdf-sync-correlate-pdf): Fix wrong parentheses. (pdf-sync-correlate-pdf, pdf-sync-synctex-file-name, pdf-sync-synctex-file-name): Make compiler happy.
2015-01-13Improved region tinkering in pdf-sync.Andreas Politz
* lisp/pdf-sync.el (pdf-sync-correlate-pdf): Remove unnecessary region handling code. * lisp/pdf-sync.el (pdf-sync-goto-tex): Widen the buffer, if necessary.
2015-01-13Removed superfluous region tinkering.Andreas Politz
* lisp/pdf-sync.el (pdf-sync-correlate-pdf): Remove unnecessary region handling code.
2015-01-13Made synctex forward search more robust.Andreas Politz
* lisp/pdf-sync.el (pdf-sync-locate-synctex-file-functions): New hook for locating the synctex database. (pdf-sync-locate-synctex-file, pdf-sync-locate-synctex-file-default): New functions for locating the synctex database (pdf-sync-synctex-file-name): Use the database to locate a proper filename for synctex. (pdf-sync-correlate-pdf): Utilize above functions.
2014-11-30Removed function alias.Andreas Politz
* lisp/pdf-view.el (pdf-util-image-size): Deleted. * lisp/pdf-sync.el (pdf-sync-correlate-tex, pdf-sync-display-pdf): Use pdf-view-image-size.
2014-11-18*** empty log message ***Andreas Politz
2014-11-14*** empty log message ***Andreas Politz
2014-11-02Handle narrowed tex buffers when goto'ing.Andreas Politz
* lisp/pdf-sync.el (pdf-sync-goto-tex): Do the right thing, if the tex buffer is narrowed.
2014-11-02Work around quirky filenames in synctex.gz.Andreas Politz
* lisp/pdf-sync.el (pdf-sync-correlate-pdf): Added workaround for filename bug in synctex.
2014-11-02Updated copyright.Andreas Politz
2014-10-31Highlight the selection of text.Andreas Politz
* lisp/pdf-info.el: New function `pdf-info-getselection'. (pdf-info-query--transform-response): Added getselection. (pdf-info-gettext): Added selection-style argument. * lisp/pdf-misc.el (pdf-misc-minor-mode-map): Added mouse binding. C-w will now copy the selected region, if there is one. (pdf-misc-selection-convert-commands): New variable. * lisp/pdf-render.el (pdf-render-redraw--1): Added silent argument. (pdf-render-redraw-document): Dito. (pdf-render-momentarily-process): Dropped caching files. * src/epdfinfo.c: Added new command getselection. (print_annot): Removed suspicous type cast. (cmd_gettext): Added selection-style argument.
2013-11-24* pdf-miscAndreas Politz
+ Use a smaller margin. * pdf-sync + Push mark before jumping to the source. + Offset not needed. * pdf-util + Reduced default timeout. * epdinfo.c + Use proper page boundaries.
2013-10-26Remove false major-mode check.Andreas Politz
2013-10-26Fix key lookup.Andreas Politz
2013-10-26Fix misspelling.Andreas Politz
2013-10-26Make sure key is bound in AUCTeX mode.Andreas Politz
2013-10-26Added documentation, renamed a variable.Andreas Politz
2013-10-26Added synctex support for correlating PDFs with TeX locations.Andreas Politz