ahungry / fast-scroll

Emacs package to ensure scrolling remains fast
GNU Affero General Public License v3.0
87 stars 5 forks source link

Font lock issue within source code block in Org mode buffer #7

Open vale46 opened 2 years ago

vale46 commented 2 years ago

Hello - I recently came across this package to improve scrolling lag when editing large files in Emacs.

However, noticing this issue when editing an org mode buffer with fast-scroll-mode. When I stop scrolling in/around a source code block when the #+begin_src emacs-lisp is not visible, font lock won't turn back on in the code block. To get it to turn back on, I need to scroll up to make #+begin_src ... line visible. Furthermore, with fast-scroll-mode off, buffer contents are rendered as expected.

My setup is doom-themes (doom-dracula theme) along with doom-modeline. If needed, I can share more setup details.

Thanks again for sharing this useful functionality.

ahungry commented 2 years ago

Interesting find! I see that if I remove fast-scroll-mode from the equation (disable or uninstall it) and run your scenario as such:

  1. Create a .org mode file and set up the emacs-lisp source block, where it contains enough contents to span more than one screen vertically
  2. Scroll down beyond begin_src line
  3. Toggle font lock mode (M-x font-lock-mode) off, and then on again
  4. It produces the error you're experiencing

As such, I believe this issue would be in font-lock-mode, or org-mode, as all this package is doing (for the most part) is toggling this font-lock-mode (and some others like minibuffer modelines) off/on with some timers.

If you could raise this issue to font-lock-mode (Emacs mailing list?) or the Org team, I wonder if we would see a fix?

philipsd6 commented 2 years ago

In the meantime is there an easy way to disable fast-scroll in OrgMode buffers?

ahungry commented 2 years ago

No, if you wanted to extend the package to have an "ignored-modes" defcustom, I would be fine with that though.