Skip to content

Commit

Permalink
Fringes redux + little reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
aikrahguzar committed Jul 10, 2024
1 parent b2a4fd2 commit 012ab12
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lisp/pdf-links.el
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ do something with it."
(unsplittable . t)
(no-other-frame . t)
(auto-hide-function . pdf-links-hide-childframe)
(left-fringe . 0)
(right-fringe . 0)
;; Setting fringes to zero causes Emacs to reserve space for truncation
;; and continuation glyphs which end up taking more space.
(left-fringe . 1)
(right-fringe . 1)
(undecorated . t))
"Frame parameters for the childframe used by `pdf-links-preview-in-childframe'."
:group 'pdf-links
Expand Down Expand Up @@ -396,15 +398,14 @@ is non-nil assume link to be at mouse position."
(let* ((width (floor (* (car pdf-links-child-frame-size)
(window-pixel-width))))
(bb (pdf-cache-boundingbox .page))
(page-width (floor (/ width (+ (- (nth 2 bb) (nth 0 bb))
pdf-view-bounding-box-margin))))
(slice (pdf-view-slice-from-bounding-box bb))
(page-width (floor (/ width (nth 2 slice))))
(height (floor (* (cdr pdf-links-child-frame-size)
(window-pixel-height))))
(page (create-image (pdf-cache-renderpage
.page page-width page-width)
(pdf-view-image-type) t
:width page-width))
.page page-width page-width)
(pdf-view-image-type) t
:width page-width))
(buffer (get-buffer-create "pdf-link-preview"))
(top-left (pdf-links--position-child-frame
link width height use-mouse-pos))
Expand All @@ -419,12 +420,12 @@ is non-nil assume link to be at mouse position."
(erase-buffer)
(insert-image page nil nil
(pdf-util-scale slice (image-size page t) 'round))
(setq mode-line-format nil)
(setq mode-line-format nil
cursor-type nil)
(goto-char (point-max))
(insert "\n"
;; This makes scrolling to the end of page much better with
;; pixel scroll precision mode. Hopefull it will also help
;; with erratic point movement.
;; pixel scroll precision mode.
(propertize " " 'display '(space :width 25 :height 1000)))
(image-mode-setup-winprops))
(set-window-point window (point-min))
Expand Down

0 comments on commit 012ab12

Please sign in to comment.