dalanicolai / pdf-continuous-scroll-mode.el

A pdf-tools extension that provides continuous scrolling functionality
GNU General Public License v3.0
144 stars 10 forks source link

Weird behavior #5

Closed NightMachinery closed 2 years ago

NightMachinery commented 4 years ago

This happens just by scrolling using (pdf-continuous-scroll-forward 30) and (pdf-continuous-scroll-backward 30): image

((system
  (type . darwin)
  (config . "x86_64-apple-darwin19.0.0")
  (shell . "/bin/dash")
  (uname . "Darwin 19.0.0 Darwin Kernel Version 19.0.0: Wed Sep 25 20:18:50 PDT 2019; root:xnu-6153.11.26~2/RELEASE_X86_64 x86_64")
  (path "~/.nix-profile/bin" "/myBin/" "~/scripts//zsh/wrappers/brishz/" "~/scripts//zsh/wrappers/Zopen.app/Contents/Resources/MainMenu.nib/" "~/scripts//zsh/wrappers/Zopen.app/Contents/Resources/" "~/scripts//zsh/wrappers/Zopen.app/Contents/MacOS/" "~/scripts//zsh/wrappers/Zopen.app/Contents/" "~/scripts//zsh/wrappers/Zopen.app/" "~/scripts//zsh/wrappers/Zath.app/Contents/Resources/MainMenu.nib/" "~/scripts//zsh/wrappers/Zath.app/Contents/Resources/" "~/scripts//zsh/wrappers/Zath.app/Contents/MacOS/" "~/scripts//zsh/wrappers/Zath.app/Contents/" "~/scripts//zsh/wrappers/Zath.app/" "~/scripts//zsh/wrappers/" "~/scripts//zsh/rss-notifier/" "~/scripts//zsh/personal/" "~/scripts//zsh/interactive/auto-load/fuzzy/" "~/scripts//zsh/interactive/auto-load/clipboard/" "~/scripts//zsh/interactive/auto-load/" "~/scripts//zsh/interactive/" "~/scripts//zsh/fattened/" "~/scripts//zsh/fastsyntax/" "~/scripts//zsh/expensive/" "~/scripts//zsh/exorbitant/" "~/scripts//zsh/ensure-run/" "~/scripts//zsh/bugs/" "~/scripts//zsh/basic/auto-load/" "~/scripts//zsh/basic/" "~/scripts//zsh/auto-load/tests/" "~/scripts//zsh/auto-load/others/web APIs/" "~/scripts//zsh/auto-load/others/scraping/" "~/scripts//zsh/auto-load/others/proxy/" "~/scripts//zsh/auto-load/others/ios/" "~/scripts//zsh/auto-load/others/clojure/" "~/scripts//zsh/auto-load/others/" "~/scripts//zsh/auto-load/bugs/" "~/scripts//zsh/auto-load/" "~/scripts//zsh/aria2-helpers/" "~/scripts//zsh/" "~/scripts//supercollider/" "~/scripts//sh/" "~/scripts//setup/macOS/" "~/scripts//setup/" "~/scripts//rust/archive/" "~/scripts//rust/" "~/scripts//ruby/" "~/scripts//resources/iterm_colorschemes/" "~/scripts//resources/audio/zsh1/" "~/scripts//resources/audio/luna_mpv/" "~/scripts//resources/audio/luna/" "~/scripts//resources/audio/HP/spells/" "~/scripts//resources/audio/HP/" "~/scripts//resources/audio/" "~/scripts//resources/" "~/scripts//python/xonsh/" "~/scripts//python/url-encode/" "~/scripts//python/telegram-send/" "~/scripts//python/tecast/" "~/scripts//python/redis/" "~/scripts//python/iterm/" "~/scripts//python/ipython/" "~/scripts//python/gmail/" "~/scripts//python/genRSS/" "~/scripts//python/email/" "~/scripts//python/autogui/" "~/scripts//python/aria2/" "~/scripts//python/" "~/scripts//launchers/" "~/scripts//javascript/" "~/scripts//golang/" "~/scripts//export/" "~/scripts//deactivated-launchers/" "~/scripts//dash/" "~/scripts//configFiles/handbrake/" "~/scripts//configFiles/" "~/scripts//clojure/" "~/scripts//bin/" "~/scripts//bash/personal/" "~/scripts//bash/examples/" "~/scripts//bash/auto-load/" "~/scripts//bash/" "~/scripts//applescript/chrome/" "~/scripts//applescript/" "~/scripts//" "/usr/local/opt/curl/bin" "/usr/local/opt/qt/bin" "/Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home" "~/bin" "~/miniconda3/bin/" "~/anaconda/bin/" "~/.nimble/bin" "~/.poetry/bin" "~/.gem/bin" "/usr/libexec/" "~/kscripts/" "/usr/local/opt/texinfo/bin" "~/go/bin" "/Base/- Code/Resources/" "~/.local/bin" "/usr/local/sbin" "/usr/local/bin" "/snap/bin" "~/.cargo/bin" "/Library/TeX/texbin" "~/.dotnet/tools" "~/.emacs.d.doom/bin/" "~/code/node/snips-alice" "/Applications/SuperCollider.app/Contents/MacOS/" "/Applications/SuperCollider.app/Contents/Resources/" "/usr/sbin" "/usr/bin" "/bin" "/sbin" "~/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-unixorn-SLASH-git-extra-commands/bin" "~/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-unixorn-SLASH-git-extra-commands/bin" "/usr/local/Cellar/emacs-plus@27/27.1/libexec/emacs/27.1/x86_64-apple-darwin19.0.0"))
 (emacs
  (dir . "~/.emacs.d.doom/")
  (version . "27.1")
  (build . "Aug 18, 2020")
  (buildopts . "--disable-dependency-tracking --disable-silent-rules --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs-plus@27/27.1/share/info/emacs --prefix=/usr/local/Cellar/emacs-plus@27/27.1 --with-xml2 --with-gnutls --without-dbus --with-imagemagick --with-modules --with-rsvg --with-xwidgets --with-ns --disable-ns-self-contained")
  (features . "RSVG IMAGEMAGICK GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS XWIDGETS PDUMPER LCMS2 GMP")
  (traits batch server-running envvar-file))
 (doom
  (dir . "~/doom.d/")
  (version . "2.0.9")
  (build . "HEAD -> develop 1456108d5 2020-09-10 18:03:32 -0400")
  (elc-files . 0)
  (modules :completion (company +tng) (ivy +fuzzy +icons) :ui doom doom-dashboard hl-todo hydra indent-guides modeline nav-flash ophints (popup +defaults) unicode vc-gutter vi-tilde-fringe :editor (evil +everywhere) file-templates fold snippets word-wrap :emacs dired electric undo vc :term vterm :checkers syntax :tools (eval +overlay) gist (lookup +dictionary +docsets +offline) magit pdf :lang clojure coq data emacs-lisp json javascript julia lua markdown (org +dragndrop +pandoc +gnuplot +jupyter +noter +present +roam) raku racket rst (ruby +rails) rust scala sh yaml :os macos :config (default +bindings))
  (packages (solarized-theme) (zoom) (blacken) (elpy) (pyvenv) (lispyville) (google-translate) (move-text) (rg) (deadgrep) (git-link) (neuron-mode) (nov) (hungry-delete) (ob-tmux) (julia-mode) (julia-repl) (eglot) (eglot-jl) (fzf) (org-drill))
  (unpin julia-mode julia-repl)
  (elpa "n/a")))
dalanicolai commented 4 years ago

Thanks for reporting. Although this package really is only a hack and I am not really trying to perfect it (i.e. you might find more weird behavior), this issue was quite easy to fix/create a workaround. So I have updated it and I hope increasing the step size will work fine now. You can set the step size via the customizable variable pdf-continuous-step-size. Please close the issue when it works fine, or let me know if it is not :+1:

NightMachinery commented 4 years ago

Thanks, that works (though it's slow).

I also added:


  (define-key pdf-continuous-scroll-mode-map (kbd "<wheel-up>") '(lambda ()
                                                                   (interactive)
                                                                   (dotimes (_ 4) (pdf-continuous-scroll-backward-line 1))))
  (define-key pdf-continuous-scroll-mode-map  (kbd "<wheel-down>") '(lambda ()
                                                                      (interactive)
                                                                      (dotimes (_ 4) (pdf-continuous-scroll-forward-line 1))))

Otherwise, the mouse wouldn't work.

You also have a typo at https://github.com/dalanicolai/pdf-continuous-scroll-mode.el/commit/ac25052289c5dc079ea252d31c3909ec11321811#r42956831.

dalanicolai commented 4 years ago

Ah great, I see I was a little sloppy (did it in a hurry before sleeping). I don't use a mouse with a wheel and scrolling on the touchpad works fine. So I will test it later today with a wheel mouse and add the bindings. Do you have to use the lamda's b.t.w? It seems to me that

(define-key pdf-continuous-scroll-mode-map (kbd "<wheel-up>") #'pdf-continuous-scroll-backward)

and its complementary forward definition should work just fine. Interesting that it is slow there because it works really very fast here on my 2014 pentium i5. Anyway, thanks for pointing these things out!

dalanicolai commented 2 years ago

Closing the issue for archiving this repo. A better implementation is available at https://github.com/dalanicolai/image-roll.el