Comments (11)
https://gist.github.com/politza/3f46785742e6e12ba0d1a849f853d0b9#file-scroll-other-window-el
from pdf-tools.
That this should not be done in PDF-Tools and that the scroll-other-window functions need to be improved is true, but this functionality is simply too useful for me to pass up, so I'm sharing the code I wrote to achieve this (I spend a lot of my time studying PDFs and taking notes in an adjoining window), which also works for other-window scrolling in info mode and any other mode you care to specify. Hopefully it will be useful to others.
http://www.toryanderson.com/files/pdf-other-window.el
from pdf-tools.
Here's a fix that works for me in case anyone needs it.
(defun my/scroll-other-window ()
(interactive)
(let* ((wind (other-window-for-scrolling))
(mode (with-selected-window wind major-mode)))
(if (eq mode 'pdf-view-mode)
(with-selected-window wind
(pdf-view-next-line-or-next-page 2))
(scroll-other-window 2))))
(defun my/scroll-other-window-down ()
(interactive)
(let* ((wind (other-window-for-scrolling))
(mode (with-selected-window wind major-mode)))
(if (eq mode 'pdf-view-mode)
(with-selected-window wind
(progn
(pdf-view-previous-line-or-previous-page 2)
(other-window 1)))
(scroll-other-window-down 2))))
from pdf-tools.
I've found that the Gist posted by @politza works for my use case; I wanted to post this code with a couple other steps that I needed to polish off the integration, hoping this saves someone else some time:
(require 'scroll-other-window)
(add-hook 'org-noter-notes-mode-hook #'sow-mode)
(setq org-noter--inhibit-location-change-handler t)
from pdf-tools.
That's a matter of scroll-other-window
not being configurable which function it should use to scroll the window, i.e. it always calls window_scroll
, a C function. Similar problem occurs when the other window displays a info
node.
from pdf-tools.
I believe this should still be possible. My approach is as follows:
Rebind C-M-v
to a function that checks to see if other-window-for-scrolling
is PDFView mode and then use the appropriate scroll function, or use the regular scroll-other-window.
However, I can't find a way to get PDFView's mode; I've tried (derived-mode-p) but PDFView doesn't seem to derive, and there seems to be no function like (doc-view-mode-p) for PDFView mode. Do you have any suggestions on moving forward on this?
from pdf-tools.
"Tory S. Anderson" [email protected] writes:
I believe this should still be possible.
Sure, but it should not be fixed in pdf-tools. Maybe you want to open
a (Emacs) feature request / bug-report.
However, I can't find a way to get PDFView's mode; I've tried
(derived-mode-p) but PDFView doesn't seem to derive [...]
That should be fixed sometime. You can use pdf-util-pdf-buffer-p' or
pdf-util-pdf-window-p'.
from pdf-tools.
"Tory S. Anderson" [email protected] writes:
That this should not be done in PDF-Tools and that the
scroll-other-window functions need to be improved is true, but this
functionality is simply too useful for me to pass up,[...]
Why don't you open a feature-request for Emacs ?
from pdf-tools.
Where/how is feature-request for emacs done?
from pdf-tools.
"Tory S. Anderson" [email protected] writes:
Where/how is feature-request for emacs done?
M-x report-emacs-bug RET
from pdf-tools.
Using the function I made I see some curious behavior that I can't understand. Scrolling down from the other window works as expected, however, scrolling up makes invisible changes UNLESS a) I switch to the buffer, which causes it to update and show me where it is now (after however many scroll-ups I've done), or b) a page-break has occurred, when it shows me the correct other-window regardless. This behavior doesn't seem to occur with scroll-down, which displays every time. Any idea why this would be? is there some difference in implementation of scroll up vs. scroll down?
from pdf-tools.
Related Issues (20)
- How can one make a selection persist HOT 2
- Open annotation text box automatically HOT 1
- (invalid-function pdf-view-current-page) HOT 1
- AUCTeX and pdf-tools: split windows configuration HOT 5
- Use Nix instead of Homebrew when nix-env is available
- Gentoo dev-util/pkgconfig no longer in repos HOT 1
- Feature request: reorder/remove pages HOT 4
- Wayland HOT 2
- Zero or negative size array HOT 1
- Error while building the epdfinfo program HOT 2
- I get this ```pdf-info-query: epdfinfo: Unable to create synctex scanner, did you run latex with `--synctex=1'``` when I double-click on a word to select it. Is it related to this? Should I switch branches on `pdf-tools` to the PR https://github.com/politza/pdf-tools/pull/527? HOT 1
- Image command Fit to window height (s h) doesn't work in PDFView mode
- Customize buttons are displayed with unraised face when emacs client launched via daemon/server
- Printing with filename that contains a space HOT 3
- italics not displayed HOT 15
- pdf-tools-20220426.2203's epdfinfo doesn't build anymore on Arch Linux (requires c++17, not c++11) HOT 6
- Adding images to pdfs HOT 2
- Cannot install on Manjaro poppler-private header HOT 3
- error when installing pdf-tools HOT 3
- FR: Double clicking on a word to highlight it HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf-tools.