3

Is it possible to temporarily disable buffer (and frame) redraws? I particuarly mean situation, when I disable some theme and enable another one, and would like to avoid a moment when emacs flashes with white background.

Illustration

To prepare, load any two dark themes in any way you like. For example eval the following snippet (I use twilight and molokai but any dark themes will do):

(load-theme 'twilight 't 't) 
(load-theme 'molokai 't 't)
(enable-theme 'twilight)

Then simulate actual problem: try eval-ing that:

(disable-theme 'twilight)
(enable-theme 'molokai)

at least in my case Emacs redraws itself in white before picking new colors, what causes unpleasant screen flash. Before you ask: reversing the order (enabling new before disabling old) does not help, in fact it sometimes flashes twice.

Solution???

I look for tricks like

(let ((inhibit-something-to-keep-emacs-from-repainting))
   (disable-theme 'twilight)
   (enable-theme 'molokai))

or maybe for another way to reload themes.

PS inhibit-redisplay, whatever it is, does not seem to help.

  • 2
    I don't have an answer for avoiding it, but please consider reporting it as a bug: M-x report-emacs-bug. – Drew Mar 5 '15 at 1:56
  • What Emacs version are you on? IIRC it's gotten better in 24.4. – wasamasa Mar 5 '15 at 6:16
  • I use 24.3.1 (this is what I got on Ubuntu 14.04). – Mekk Mar 5 '15 at 12:44
  • I installed 24.4.1, things did not change much (well, maybe it goes somewhat faster, but there still is a white flash). – Mekk Mar 6 '15 at 14:06
  • (as a complete sidenote, I am happy to upgrade as I can type → in emacs again – dead key works again, I missed it so much...) – Mekk Mar 6 '15 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.