Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid redrawing everything on every page change #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kqr
Copy link

@kqr kqr commented Jun 19, 2019

By running (redraw-display), we cause a noticeable flicker in /all/ open Emacs
frames, which, while not catastrophic, is a bit of a rough edge.

If we instead redraw only the currently selected frame, we still cause a brief
flash in the presenting frame, but not in any other frames.

My current workaround for this is to add advice around redraw-display and simply
run redraw-frame instead if the major mode is epresent-mode, like-a-so:

(define-advice redraw-display
      (:around (actual-redraw &rest args) epresent-only-redisplay-frame)
    (if (eq major-mode 'epresent-mode)
        (apply 'redraw-frame (cons nil args))
      (apply actual-redraw args)))

By running (redraw-display), we cause a noticeable flicker in /all/ open Emacs
frames, which, while not catastrophic, is a bit of a rough edge.

If we instead redraw only the currently selected frame, we still cause a brief
flash in the presenting frame, but not in any other frames.

My current workaround for this is to add advice around redraw-display and simply
run redraw-frame instead if the major mode is epresent-mode, like-a-so:

(define-advice redraw-display
      (:around (actual-redraw &rest args) epresent-only-redisplay-frame)
    (if (eq major-mode 'epresent-mode)
        (apply 'redraw-frame (cons nil args))
      (apply actual-redraw args)))
@kqr
Copy link
Author

kqr commented Jun 19, 2019

It is worth noting that I have tried briefly running this completely without the
redraw, and I haven't noticed any negative behaviour – only a more smooth
presentation experience. That said, I haven't done any thorough testing either,
so I won't have too strong opinions on it. Not to mention that my Emacs
display-fu is very, very weak.

If we want to experiment, we could set up a defcustom variable for toggling
whether or not to redraw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants