Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
a02d45b
Implement a child frame based preview for links
aikrahguzar Oct 5, 2023
ab5f673
Reinterpret pdf-isearch-narrow-to-page for pdf-roll
aikrahguzar Oct 6, 2023
eaf2124
Add an isearch version of preview command
aikrahguzar Oct 6, 2023
dc6eebd
Actually set the variable in `pdf-roll-margin-color` :set
aikrahguzar Oct 11, 2023
fa725e1
Make sure not to pass nil to make-frame-invisible
aikrahguzar Oct 12, 2023
ef14959
Make backward sync accurate with long source lines
aikrahguzar Nov 12, 2023
99f756d
Prioritize alignment of larger words
aikrahguzar Nov 12, 2023
ea9dead
A hueristic for forward search
aikrahguzar Nov 18, 2023
91cd035
Don't search non-existent pages
aikrahguzar Nov 20, 2023
751ebe0
Only use heuristic if regexp has a single match
aikrahguzar Nov 20, 2023
61c3ceb
Make sure the child frame exists
aikrahguzar Nov 28, 2023
7565abb
Add ability to auto trigger child frame preview
aikrahguzar Dec 31, 2023
28e8249
Allow cursor on margin
aikrahguzar Mar 26, 2024
59859ab
Fix pdf-sync when slicing is involved
aikrahguzar Apr 18, 2024
572abba
Make auto-slicing work properly with pdf-roll
aikrahguzar Apr 19, 2024
55efc70
Fix preview due to erratic 'pos-visible-in-window-p'
aikrahguzar Apr 20, 2024
8ea4e73
auto-slicing: also set/reset default slice
aikrahguzar Apr 27, 2024
d580c7c
Fix docstring for p-r-maybe-slice-images
aikrahguzar May 9, 2024
0018057
Use save-restriction with small body.
aikrahguzar May 29, 2024
c81dd60
Fix mouse scrolling of child frame
aikrahguzar Jun 14, 2024
0e04694
Fix help-echo calling convention + preview from non-selected win
aikrahguzar Jun 22, 2024
3c1f5ff
Fix calculation of child-frame coordinates
aikrahguzar Jun 27, 2024
fc94189
Reset state when child frame is hidden
aikrahguzar Jun 27, 2024
888d6d6
When preview is visible scroll the preview
aikrahguzar Jun 28, 2024
55f3a6f
Fix moving over a new link while preview is active
aikrahguzar Jun 28, 2024
db6b602
Hopefully prevent erratic point movement
aikrahguzar Jul 4, 2024
01dec87
Add setter for pdf-links-child-frame-parameters
aikrahguzar Jul 4, 2024
69a1bd0
Remove fringes
aikrahguzar Jul 4, 2024
e4c0f4d
Allow overriding vscroll setting from the link
aikrahguzar Jul 7, 2024
7697b30
Fringes redux + little reorganization
aikrahguzar Jul 10, 2024
ca6ad05
Mark preview buffer as unimportant
aikrahguzar Jul 10, 2024
58a0706
Tiny simplification
aikrahguzar Jul 21, 2024
297d8c5
Adapting to changes in pdf-view-goto-page
aikrahguzar Aug 4, 2024
2fbd580
Further adjustments
aikrahguzar Aug 5, 2024
a1cd244
Take 3
aikrahguzar Aug 6, 2024
b4f8bc1
Better scrolling for single page pdf
aikrahguzar Sep 7, 2024
4ed4aad
Handle function value for slice when jumping to a bookmark
aikrahguzar Sep 26, 2024
be2aa79
Another tweak to scrolling on the last page
aikrahguzar Oct 2, 2024
ffd52ad
Refactor bookmark handling
aikrahguzar Nov 2, 2024
e8abe6e
Don't make the last entry of bookmark record a constant
aikrahguzar Nov 12, 2024
c420f02
More accurate forward search using synctex subprocess
aikrahguzar Nov 17, 2024
9d189ab
Restore origin only once
aikrahguzar Nov 18, 2024
9079e30
Avoid pos-visible-in-window-p during redisplay
aikrahguzar Nov 18, 2024
25961dd
Correct clamping of bounding box
aikrahguzar Nov 20, 2024
fdb42c0
Include window point in state, not the point
aikrahguzar Nov 21, 2024
3b37237
Simplify scroll-forward/backward
aikrahguzar Nov 22, 2024
7956562
Command to scroll to the end of last displayed page
aikrahguzar Nov 22, 2024
3c72d3d
Handle negative arg to scroll forward/backward correctly
aikrahguzar Nov 22, 2024
59cf449
Command to go to position of a mouse event
aikrahguzar Nov 25, 2024
4bebdf2
Don't activate mark as it can mess up internal-region-overlay
aikrahguzar Nov 30, 2024
e194485
Take slicing into account when computing required vscroll
aikrahguzar Dec 13, 2024
8b9b423
Fix child frame preview with slices.
aikrahguzar Dec 13, 2024
ea1a2f2
Don't assume we are only ones creating overlays in the buffer
aikrahguzar Dec 18, 2024
d14907a
Revert "Don't activate mark as it can mess up ..."
aikrahguzar Dec 18, 2024
edcf4da
Fix subtracting offset twice from tooltip location + formatting
aikrahguzar Dec 22, 2024
7cd704a
Remove a re-search-forward
aikrahguzar Jan 11, 2025
9fb3968
Allowing the choice between highlighting and tooltip in sync
Jan 21, 2025
93c1111
Unhighlight pages even when the window disappear
Jan 21, 2025
d075653
Prevent errors if prefetching starts too early for us
Jan 21, 2025
0e315e2
Fix error in pdf-links if pdf-roll is not loaded.
Feb 10, 2025
1f4c04b
Reset state on revert
Feb 11, 2025
f9675d8
Use defvars to accomplish what pdf-roll needs
Feb 12, 2025
07c0b49
Fix pdf-view-image-offset to return integers
Feb 15, 2025
58956d2
Slight refactor of pdf-roll-scroll-to-end-of-page
Feb 15, 2025
03bd69d
Limit pixel scrolling exception to pre-redisplay
Feb 16, 2025
45b9cc0
Make sure to find the correct overlay
Feb 17, 2025
df14c2b
Put back part of the hack for pixel-scroll-precision-mode
Feb 17, 2025
4452e4b
Don't create image when caching image data
Feb 19, 2025
0ee3bbc
Aggressively flush images
Feb 21, 2025
eee10f1
Flush previous images without pdf-roll too
Feb 22, 2025
a39251f
Silence some byte compiler warnings
Feb 23, 2025
8b5350c
Don't try to flush when there is no image
Feb 27, 2025
59b6398
Fix tooltip arrow to work with new defvars
Feb 28, 2025
52246f4
Use enable-theme-functions on Emacs > 28
Feb 28, 2025
f6bff39
Fix bookmark-make-record to work without displayed images
Mar 3, 2025
044c96a
redisplay: add ultra-scroll functions to pscrolling lexical
Apr 4, 2025
99f0c26
roll: fix remap of scroll up/down (SPC binding).
Apr 4, 2025
564ffb2
pdf-links-preview: explicitly set image-scaling-factor to 1
May 2, 2025
909267e
Don't try to find origin of buffers not displayed in a live window
May 10, 2025
0566a7d
Fix #10: Remap isearch face so that the prefix is not highlighted
Jul 23, 2025
a8f1d61
Fix region dragging
Aug 8, 2025
d791426
Fix #11
Oct 18, 2025
aee49c9
Stop Emacs 30 from computing original map in create-image
Oct 20, 2025
b6ca1d9
Don't use image-size during redisplay
Oct 20, 2025
161e827
Value t for :original-map is dangerous
Oct 21, 2025
d43120d
Fix vedang/pdf-tools#341
Jan 27, 2026
96f3967
Fix vedang/pdf-tools#340
Jan 29, 2026
be1a29e
Consider all windows when turning off pdf-view-roll-minor-mode
Jan 29, 2026
8ba82ee
Loop over winprops directly when turning off pdf-roll
Jan 30, 2026
26dde29
Don't use 'displayed-pages winprop outside pdf-roll
Feb 6, 2026
cd85c52
Revert changes related to flushing images to conserve memory.
Feb 13, 2026
3b35438
Avoid hitting the assertion pdf-view-new-window-function
Mar 6, 2026
b80b49c
Fix typo in quoting and a little reformatting
Mar 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lisp/pdf-annot.el
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ other annotations."
:map (pdf-view-apply-hotspot-functions
window page size)
:width (car size))
(when pdf-view-roll-minor-mode page)))
page))
(pdf-util-scroll-to-edges
(pdf-util-scale-relative-to-pixel (car edges)))))))

Expand Down Expand Up @@ -1129,9 +1129,7 @@ Return the new annotation."
(list posn)))
(pdf-util-assert-pdf-window)
(when (posnp pos)
(setq page (or page
(when pdf-view-roll-minor-mode
(1+ (/ (posn-point pos) 4)))))
(setq page (pdf-view-posn-page pos))
(setq pos (posn-object-x-y pos)))
(let ((isize (pdf-view-image-size))
(x (car pos))
Expand Down Expand Up @@ -1576,6 +1574,11 @@ scroll the current page."

;; TODO 'merge' this function with `pdf-links-read-link-action' into a single
;; universal 'read-action' function (in `pdf-util'?)

(autoload 'pdf-links-read-link-action--create-keys "pdf-links")
(declare-function pdf-links-read-link-action--read-chars "pdf-links")
(defvar pdf-links-convert-pointsize-scale)
(defvar pdf-links-read-link-convert-commands)
(defun pdf-annot-read-annot (prompt)
"Using PROMPT, interactively read an annot-action.

Expand Down Expand Up @@ -1617,7 +1620,7 @@ See `pdf-annot-edit' for the interface."
(car size) image-data 'pdf-annot-read-annot))
(pdf-view-display-image
(create-image image-data (pdf-view-image-type) t)
(when pdf-view-roll-minor-mode (pdf-view-current-page)))
(pdf-view-current-page))
(pdf-links-read-link-action--read-chars prompt alist))
(pdf-view-redisplay))))

Expand Down
1 change: 1 addition & 0 deletions lisp/pdf-cache.el
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ Used solely in `pdf-cache--prefetch-start'.")
(defun pdf-cache--prefetch-start (buffer)
"Start prefetching images in BUFFER."
(when (and pdf-cache-prefetch-minor-mode
(pdf-view-current-page)
(not pdf-cache--prefetch-started-p)
(pdf-util-pdf-buffer-p)
(not isearch-mode)
Expand Down
39 changes: 12 additions & 27 deletions lisp/pdf-isearch.el
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ This is a Isearch interface function."
(when (> (length string) 0)
(let ((same-search-p (pdf-isearch-same-search-p))
(oldpage pdf-isearch-current-page)
(pages (or (image-mode-window-get 'displayed-pages (selected-window))
(list (pdf-view-current-page))))
(pages (reverse (pdf-view-displayed-pages (selected-window))))
matches
next-match)
(dolist (page pages)
Expand Down Expand Up @@ -284,23 +283,16 @@ This is a Isearch interface function."
;; Don't get off track.
(when (or (and (bobp) (not isearch-forward))
(and (eobp) isearch-forward))
(unless pdf-view-roll-minor-mode
(goto-char (1+ (/ (buffer-size) 2)))))
;; Signal success to isearch.
;; Moving the point is for `pdf-roll'. It ensures that
;; `re-search-forward' takes us back to the starting point. Otherwise
;; every call to `isearch-repeat' will increment/decrement the point
;; and that causes recentering.
(goto-char (1+ (/ (buffer-size) 2))))
(if isearch-forward
(progn (unless (bobp) (forward-char -1))
(re-search-forward "."))
(unless (eobp) (forward-char 1))
(re-search-forward ".")
(re-search-backward ".")))
((and (not pdf-isearch-narrow-to-page)
(not (pdf-isearch-empty-match-p pdf-isearch-current-matches)))
((not (pdf-isearch-empty-match-p pdf-isearch-current-matches))
(let ((next-page (pdf-isearch-find-next-matching-page
string pdf-isearch-current-page t)))
(when next-page
(when (and next-page
(or (not pdf-isearch-narrow-to-page)
(memq next-page pages)))
(pdf-view-goto-page next-page)
(pdf-isearch-search-function string))))))))

Expand All @@ -324,9 +316,7 @@ This is a Isearch interface function."
(pdf-isearch-hl-matches
pdf-isearch-current-match
pdf-isearch-current-matches
nil (image-mode-window-get 'displayed-pages (selected-window)))
(when pdf-view-roll-minor-mode
(pdf-view-redisplay)))
nil (pdf-view-displayed-pages)))
(image-set-window-hscroll hscroll)
(image-set-window-vscroll vscroll))))

Expand Down Expand Up @@ -362,8 +352,7 @@ This is a Isearch interface function."
pdf-isearch-current-match nil
pdf-isearch-current-matches nil
pdf-isearch-current-parameter nil)
(unless pdf-view-roll-minor-mode
(goto-char (1+ (/ (buffer-size) 2)))))
(goto-char (1+ (/ (buffer-size) 2))))

(defun pdf-isearch-same-search-p (&optional ignore-search-string-p)
"Return non-nil, if search parameter have not changed.
Expand Down Expand Up @@ -405,8 +394,7 @@ there was no previous search, this function returns t."
pdf-isearch-current-match
pdf-isearch-current-matches
nil
(or (image-mode-window-get 'displayed-pages (selected-window))
(list (pdf-view-current-page)))))
(pdf-view-displayed-pages (selected-window))))

(defun pdf-isearch-update ()
"Update search and redisplay, if necessary."
Expand Down Expand Up @@ -744,9 +732,7 @@ MATCH-BG LAZY-FG LAZY-BG\)."
(cl-destructuring-bind (fg1 bg1 fg2 bg2)
(pdf-isearch-current-colors)
(let* ((window (selected-window))
(pages (or pages
(image-mode-window-get 'displayed-pages (selected-window))
(list (pdf-view-current-page))))
(pages (or pages (pdf-view-displayed-pages window)))
(buffer (current-buffer))
(tick (cl-incf pdf-isearch--hl-matches-tick)))
(dolist (page pages)
Expand All @@ -763,8 +749,7 @@ MATCH-BG LAZY-FG LAZY-BG\)."
(when (and (derived-mode-p 'pdf-view-mode)
(or isearch-mode occur-hack-p
(memq last-command '(isearch-repeat-forward isearch-repeat-backward)))
(or (eq page (pdf-view-current-page))
(memq page (image-mode-window-get 'displayed-pages window))))
(memq page (pdf-view-displayed-pages window)))
(pdf-view-display-image
(pdf-view-create-image data :width width)
page window)))))))
Expand Down
Loading
Loading