Subject: bug#13727: 24.3.50; terminal emacs flickers when redrawing frame

From: "Jose A. Ortega Ruiz" <[email-masked]>
Date: Sat, 16 Feb 2013 02:38:51 +0100

Since a month ago, using emacs-snapshot (so pretty close to the Bzr
head), in terminal mode (both in xterm and urxvt), i'm experiencing
flickers and slow redraws in several modes.  Perhaps the easiest to
reproduce is using Gnus with a multiwindow layout (3 windows visible:
groups, message list and message body), where entering the next group
(which causes almost a complete redraw) produces a very noticeable
flicker, specially when the mode lines are redrawn.

For instance, right now, composing this bug report, the flicker is very
noticeable (perhaps due to the special self-deletable text in the
email?), although it comes and goes...

In vanilla emacs 24.2/3 the redraw is immediate and totally invisible.

I also sometimes see flickers when fontify region is doing its thing.

In GNU Emacs 24.3.50.1 (i486-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2013-02-15 on dex, modified by Debian
 (emacs-snapshot package, version 2:20130215-1)
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:	Debian GNU/Linux 7.0 (wheezy)

Configured using:
 `configure --build i486-linux-gnu --host i486-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.3.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3.50/site-lisp:/usr/share/emacs/site-lisp
 --without-compress-info --with-crt-dir=/usr/lib/i386-linux-gnu/
 --with-x=yes --with-x-toolkit=lucid CFLAGS='-DDEBIAN
 -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' CPPFLAGS='-D_FORTIFY_SOURCE=2'
 LDFLAGS='-g -Wl,--as-needed -znocombreloc''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Circe Channel

Minor modes in effect:
  diff-auto-refine-mode: t
  winner-mode: t
  recentf-mode: t
  ido-everywhere: t
  shell-dirtrack-mode: t
  ncm-mode: t
  tracking-mode: t
  show-paren-mode: t
  global-auto-revert-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t

Recent input:
) <return> C-c C-SPC C-c C-SPC n a n i t <return> m 
u a <return> C-c g n q g . SPC <return> <return> <return> 
<return> <return> <return> <return> <return> <return> 
<return> u n n n n n C-c f C-c C-SPC C-x 5 0 ESC [ 
> 0 ; 2 7 8 ; 0 c ESC ] 1 1 ; r g b : f f f f / f f 
f f / f f f f ESC \ C-x b r c C-s RET C-e ESC C-b C-n 
C-e ESC C-b C-e C-p ESC x c h e c k - a p r DEL DEL 
DEL p a r TAB RET C-e ESC C-b C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-n C-n C-n C-a ESC C-f C-c j C-x C-s C-x C-c ESC [ 
> 0 ; 2 7 8 ; 0 c ESC ] 1 1 ; r g b : f f f f / f f 
f f / f f f f ESC \ C-x C-c C-c f C-c g . SPC SPC n 
n n n n n n n n n n ESC [ > 0 ; 2 7 8 ; 0 c ESC ] 1 
1 ; r g b : f f f f / f f f f / f f f f ESC \ <help-echo> 
<switch-frame> <switch-frame> C-x 3 C-c C-@ <switch-frame> 
<switch-frame> ESC x r e p o TAB t - b u TAB DEL DEL 
DEL DEL r t - b u TAB RET

Recent messages:
Reading incoming mail from file... [2 times]
nnml: Reading incoming mail (no new mail)...done
Reading active file via nnml...done
nnimap read 0k from imap.gmail.com
nnimap read 15k from imap.gmail.com
nnimap read 19k from imap.gmail.com
Reading active file via nndraft...done
Checking new news...done
When done with this frame, type C-x 5 0
Making completion list...

Load-path shadows:
/home/jao/etc/emacs/site/custom/jao-themes hides /home/jao/lib/elisp/jao/themes/jao-themes
/home/jao/.emacs.d/elpa/edit-list-0.4/edit-list hides /home/jao/etc/emacs/lib/edit-list
/home/jao/.emacs.d/elpa/paredit-20110508.1256/paredit hides /home/jao/etc/emacs/lib/paredit
/home/jao/.emacs.d/elpa/undo-tree-20130119.926/undo-tree hides /home/jao/etc/emacs/lib/undo-tree
/home/jao/.emacs.d/elpa/lacarte-20121228.1947/lacarte hides /home/jao/etc/emacs/lib/lacarte
/home/jao/etc/emacs/site/custom/jao-emms-config hides /home/jao/etc/emacs/custom/jao-emms-config
/home/jao/etc/emacs/site/custom/jao-prolog hides /home/jao/etc/emacs/custom/jao-prolog
/home/jao/etc/emacs/site/custom/jao-mode-line hides /home/jao/etc/emacs/custom/jao-mode-line
/home/jao/etc/emacs/site/custom/jao-dict hides /home/jao/etc/emacs/custom/jao-dict
/home/jao/etc/emacs/site/custom/jao-maxima hides /home/jao/etc/emacs/custom/jao-maxima
/home/jao/etc/emacs/site/custom/jao-frames hides /home/jao/etc/emacs/custom/jao-frames
/home/jao/etc/emacs/site/custom/jao-w3m hides /home/jao/etc/emacs/custom/jao-w3m
/home/jao/etc/emacs/site/custom/jao-vc hides /home/jao/etc/emacs/custom/jao-vc
/home/jao/etc/emacs/site/custom/jao-custom hides /home/jao/etc/emacs/custom/jao-custom
/home/jao/etc/emacs/site/custom/jao-colors hides /home/jao/etc/emacs/custom/jao-colors
/home/jao/etc/emacs/site/custom/jao-epg hides /home/jao/etc/emacs/custom/jao-epg
/home/jao/etc/emacs/site/custom/jao-clojure hides /home/jao/etc/emacs/custom/jao-clojure
/home/jao/etc/emacs/site/custom/jao-time hides /home/jao/etc/emacs/custom/jao-time
/home/jao/etc/emacs/site/custom/jao-session hides /home/jao/etc/emacs/custom/jao-session
/home/jao/etc/emacs/site/custom/jao-deft hides /home/jao/etc/emacs/custom/jao-deft
/home/jao/etc/emacs/site/custom/jao-gnuplot hides /home/jao/etc/emacs/custom/jao-gnuplot
/home/jao/etc/emacs/site/custom/jao-diary hides /home/jao/etc/emacs/custom/jao-diary
/home/jao/etc/emacs/site/custom/jao-ido hides /home/jao/etc/emacs/custom/jao-ido
/home/jao/etc/emacs/site/custom/jao-utils hides /home/jao/etc/emacs/custom/jao-utils
/home/jao/etc/emacs/site/custom/jao-python hides /home/jao/etc/emacs/custom/jao-python
/home/jao/etc/emacs/site/custom/jao-buffers hides /home/jao/etc/emacs/custom/jao-buffers
/home/jao/etc/emacs/site/custom/jao-sawfish hides /home/jao/etc/emacs/custom/jao-sawfish
/home/jao/etc/emacs/site/custom/jao-snippets hides /home/jao/etc/emacs/custom/jao-snippets
/home/jao/etc/emacs/site/custom/jao-muse hides /home/jao/etc/emacs/custom/jao-muse
/home/jao/etc/emacs/site/custom/jao-factor hides /home/jao/etc/emacs/custom/jao-factor
/home/jao/etc/emacs/site/custom/jao-slime hides /home/jao/etc/emacs/custom/jao-slime
/home/jao/etc/emacs/site/custom/jao-edit hides /home/jao/etc/emacs/custom/jao-edit
/home/jao/etc/emacs/site/custom/jao-namazu hides /home/jao/etc/emacs/custom/jao-namazu
/home/jao/etc/emacs/site/custom/jao-c hides /home/jao/etc/emacs/custom/jao-c
/home/jao/etc/emacs/site/custom/jao-auto hides /home/jao/etc/emacs/custom/jao-auto
/home/jao/etc/emacs/site/custom/jao-ruby hides /home/jao/etc/emacs/custom/jao-ruby
/home/jao/etc/emacs/site/custom/jao-project-root hides /home/jao/etc/emacs/custom/jao-project-root
/home/jao/etc/emacs/site/custom/jao-kbd hides /home/jao/etc/emacs/custom/jao-kbd
/home/jao/etc/emacs/site/custom/jao-eshell hides /home/jao/etc/emacs/custom/jao-eshell
/home/jao/etc/emacs/site/custom/jao-gnus hides /home/jao/etc/emacs/custom/jao-gnus
/home/jao/etc/emacs/site/custom/jao-skels hides /home/jao/etc/emacs/custom/jao-skels
/home/jao/etc/emacs/site/custom/jao-compile hides /home/jao/etc/emacs/custom/jao-compile
/home/jao/etc/emacs/site/custom/jao-docview hides /home/jao/etc/emacs/custom/jao-docview
/home/jao/etc/emacs/site/custom/jao-undo-tree hides /home/jao/etc/emacs/custom/jao-undo-tree
/home/jao/etc/emacs/site/custom/jao-org hides /home/jao/etc/emacs/custom/jao-org
/home/jao/etc/emacs/site/custom/jao-browse-url hides /home/jao/etc/emacs/custom/jao-browse-url
/home/jao/etc/emacs/site/custom/jao-lisp hides /home/jao/etc/emacs/custom/jao-lisp
/home/jao/etc/emacs/site/custom/jao-elisp hides /home/jao/etc/emacs/custom/jao-elisp
/home/jao/etc/emacs/site/custom/jao-haskell hides /home/jao/etc/emacs/custom/jao-haskell
/home/jao/etc/emacs/site/custom/jao-mail hides /home/jao/etc/emacs/custom/jao-mail
/home/jao/etc/emacs/site/custom/jao-markdown hides /home/jao/etc/emacs/custom/jao-markdown
/home/jao/etc/emacs/site/custom/jao-babel hides /home/jao/etc/emacs/custom/jao-babel
/home/jao/etc/emacs/site/custom/jao-dired hides /home/jao/etc/emacs/custom/jao-dired
/home/jao/etc/emacs/site/custom/jao-fold hides /home/jao/etc/emacs/custom/jao-fold
/home/jao/etc/emacs/site/custom/jao-circe hides /home/jao/etc/emacs/custom/jao-circe
/home/jao/etc/emacs/site/custom/jao-erlang hides /home/jao/etc/emacs/custom/jao-erlang
/home/jao/etc/emacs/site/custom/jao-fonts hides /home/jao/etc/emacs/custom/jao-fonts
/home/jao/etc/emacs/lib/namazu hides /usr/share/emacs-snapshot/site-lisp/namazu/namazu
/home/jao/etc/emacs/lib/gnus-nmz-1 hides /usr/share/emacs-snapshot/site-lisp/namazu/gnus-nmz-1
/home/jao/.emacs.d/elpa/erlang-20120831.1448/erlang-skels hides /usr/share/emacs-snapshot/site-lisp/erlang/erlang-skels
/home/jao/.emacs.d/elpa/erlang-20120831.1448/erlang-start hides /usr/share/emacs-snapshot/site-lisp/erlang/erlang-start
/home/jao/.emacs.d/elpa/erlang-20120831.1448/erlang-eunit hides /usr/share/emacs-snapshot/site-lisp/erlang/erlang-eunit
/home/jao/.emacs.d/elpa/erlang-20120831.1448/erlang_appwiz hides /usr/share/emacs-snapshot/site-lisp/erlang/erlang_appwiz
/home/jao/.emacs.d/elpa/erlang-20120831.1448/erlang-skels-old hides /usr/share/emacs-snapshot/site-lisp/erlang/erlang-skels-old
/home/jao/.emacs.d/elpa/erlang-20120831.1448/erlang hides /usr/share/emacs-snapshot/site-lisp/erlang/erlang
/home/jao/.emacs.d/elpa/erlang-20120831.1448/erlang-flymake hides /usr/share/emacs-snapshot/site-lisp/erlang/erlang-flymake
/usr/share/emacs/24.3.50/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/home/jao/lib/elisp/project-root/find-cmd hides /usr/share/emacs/24.3.50/lisp/find-cmd
/home/jao/etc/emacs/lib/cap-words hides /usr/share/emacs/24.3.50/lisp/progmodes/cap-words
~/lib/elisp/ob-scheme hides /usr/share/emacs/24.3.50/lisp/org/ob-scheme
/home/jao/.emacs.d/elpa/magit-20130215.2225/.dir-locals hides /usr/share/emacs/24.3.50/lisp/gnus/.dir-locals
/home/jao/lib/elisp/emms/tq hides /usr/share/emacs/24.3.50/lisp/emacs-lisp/tq
/home/jao/.emacs.d/elpa/markdown-mode-20130121.1039/markdown-mode hides /home/jao/usr/bigml/emacs/ext/markdown-mode

Features:
(shadow emacsbug mm-archive qp quail sawfish scheme smerge-mode
diff-mode vc pp crm ffap view cal-iso org-latex org-export-latex
org-beamer org-exp ob-exp org-exp-blocks footnote org-mobile org-info
org-gnus org-bibtex bibtex org-bbdb org-agenda gnus-cite gnus-async
gnus-bcklg gnus-ml w3m-symbol copyright misearch multi-isearch
vc-dispatcher vc-darcs gnus-topic utf-7 nnimap utf7 nnml netrc
network-stream starttls tls gnus-registry registry eieio-base nnir
gnus-delay gnus-draft gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-cache gnus-msg nndraft nnmh gnus-demon nntp w3m-cookie
mule-util w3m-form w3m-bookmark w3m-tabmenu w3m-session windmove winner
server melpa bml bml-misc bml-clojure bml-python bml-skels bml-utils
geiser fuel-skel cpp-skel jao-w3m w3m doc-view image-mode w3m-hist
w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc
w3m-util w3m-load jao-vc jao-utils battery jao-undo-tree undo-tree diff
jao-snippets cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs snippet jao-slime slime-autoloads
jao-skels texinfo-skel lisp-skel muse-skel haskell-skel scsh-skel
init-skel common-skel skeleton autoinsert jao-session recentf
tree-widget saveplace jao-sawfish jao-ruby ruby-mode jao-python
virtualenv python jao-prolog jao-project-root project-root find-cmd
jao-org org-man jao-org-gnus jao-org-links jao-devon jao-applescript
jao-org-utils org ob-tangle ob-ref ob-lob ob-table org-footnote org-src
ob-comint ob-keys org-pcomplete org-list org-faces org-entities
org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs
find-func jao-namazu namazu jao-muse muse-journal muse-book muse-latex
muse-wiki muse-colors muse-html muse-xml-common muse-publish
muse-project muse-protocols muse-regexps muse muse-nested-tags muse-mode
jao-mode-line jao-time time jao-maxima jao-markdown jao-mail randomsig
bbdb-gnus gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum
nnoo gnus-group gnus-undo nnmail mail-source gnus-start gnus-spec
gnus-int gnus-range gnus-win gnus gnus-ems nnheader bbdb-snarf mail-extr
bbdb-com bbdb timezone gnutls smtpmail sendmail message rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev mail-utils gmm-utils mailheader jao-lisp info-look
jao-kbd jao-ido ido jao-haskell jao-cabal jao-dominating-file jao-gnus
jao-gnuplot jao-frames jao-fonts jao-fold fold-dwim hideshow noutline
outline jao-factor jao-eshell esh-toggle jao-erlang jao-emms-config
spotify dbus jao-emms-info-track jao-emms jao-osd jao-emms-lyrics
jao-emms-random-album emms-info-metaflac emms-playlist-limit emms-volume
emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info
emms-metaplaylist-mode emms-bookmarks emms-lastfm-client xml parse-time
emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort
emms-last-played emms-player-xine emms-player-mpd tq emms-playing-time
emms-lyrics emms-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse url-vars mailcap
emms-streams emms-tag-editor emms-mark emms-mode-line emms-cache
emms-info-ogginfo emms-info-mp3info emms-info later-do
emms-playlist-mode emms-player-vlc emms-player-mplayer
emms-player-simple emms-source-playlist emms-source-file emms-setup emms
emms-compat jao-elisp jao-edit edit-server jao-dired help-mode dired+
dired-x ediff-merg ediff-diff ediff-wind ediff-mult ediff-help
ediff-init ediff-util dired-aux dired jao-dict jao-diary cal-china lunar
solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs
vc-git appt diary-lib diary-loaddefs cal-menu calendar cal-loaddefs
jao-deft deft jao-custom jao-compile jao-colors jao-light-theme
jao-themes jao-clojure nrepl eldoc arc-mode archive-mode etags thingatpt
clojure-mode imenu inf-lisp tramp tramp-compat tramp-loaddefs shell
pcomplete format-spec jao-fci fill-column-indicator paredit jao-circe
circe circe-fixes lui-irc-colors lcs lui-format lui rx tracking cl-macs
gv edmacro kmacro easy-mmode flyspell ispell jao-epg epa-file epa
derived epg epg-config auth-source eieio gnus-util mm-util mail-prsvr
password-cache jao-c jao-buffers jka-compr cus-edit cus-start cus-load
wid-edit paren uniquify time-date autorevert jao-browse-url jao-docview
jao-doc-view term disp-table ehelp electric browse-url cl cl-lib
jao-babel jao-auto jao-elpa auctex-autoloads tex-site deft-autoloads
diff-hl-autoloads edit-list-autoloads erlang-autoloads
eshell-manual-autoloads git-gutter-autoloads gitconfig-mode-autoloads
htmlize-autoloads jabber-autoloads lacarte-autoloads magithub-autoloads
finder-inf magit-autoloads markdown-mode-autoloads melpa-autoloads
byte-opt warnings bytecomp byte-compile cconv nadvice advice help-fns
memory-usage-autoloads muse-autoloads info easymenu paredit-autoloads
smartrep-autoloads sml-mode-autoloads spotify-autoloads
sr-speedbar-autoloads undo-tree-autoloads virtualenv-autoloads package-x
package compile comint ansi-color ring erlang-start bbdb-autoloads
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind inotify
dynamic-setting system-font-setting font-render-setting x-toolkit x
multi-tty emacs)

-- 
The fact that a believer is happier than a skeptic is no more to the point
than the fact than a drunken man is happier than a sober one.
 -George Bernard Shaw, writer, Nobel laureate (1856-1950)