Subject: bug#14213: 24.3; Redraw artifacts with emacs cursor and highlighting

From: Chris Rose <[email-masked]>
Date: Mon, 15 Apr 2013 14:09:28 -0700

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

When editing text, I odd cursor shadows and leftover, un-redrawn text as
I type; for example, during the typing of this sentence the letters on
this line were often obscured by the cursor appearing over them, as well
as appearing on the current line.

This is best shown in an image: http://imgur.com/IjAxNWC

I am running emacs as a daemon on a RHEL5 64 bit host, and running emacsclient there as well, using an Xorg server on Ubuntu 12.04
emacs daemon command line:
ssh -f -o ForwardAgent=no -o ForwardX11=no -o ForwardX11Trusted=no chrisros.desktop 'DISPLAY= nohup ~/bin/emacs -nw --daemon 2>&1 >/dev/null'
ssh -f chrisros.desktop '~/bin/emacsclient -c'

If I run emacs daemon with -Q, the issue persists:
ssh -f chrisros.desktop 'DISPLAY= nohup ~/bin/emacs -Q -nw --daemon 2>&1 >/dev/null'
ssh -f chrisros.desktop '~/bin/emacsclient -c'

Image with emacs --daemon -Q: http://imgur.com/v7ZOKtA

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/home/chrisros/share/emacs/24.3/etc/DEBUG.

In GNU Emacs 24.3.3 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2013-03-11 on chrisros.desktop.amazon.com
Windowing system distributor `The X.Org Foundation', version 11.0.11103000
System Description:	Red Hat Enterprise Linux Client release 5.4 (Tikanga)

Configured using:
 `configure '--prefix=/home/chrisros' '--with-x-toolkit=lucid'
 '--enable-link-time-optimization''

Important settings:
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: ReST
(however, the bug occurs in python-mode, shell-mode, and the minibuffer,
as well as in this message mode.)

Minor modes in effect:
  which-function-mode: t
  diff-auto-refine-mode: t
  hl-line-mode: t
  nxhtml-menu-mode: t
  shell-dirtrack-mode: t
  global-edit-server-edit-mode: t
  url-handler-mode: t
  iswitchb-mode: t
  global-auto-complete-mode: t
  yas/global-mode: t
  yas/minor-mode: t
  show-paren-mode: t
  global-whitespace-mode: t
  electric-pair-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-fill-mode: 1

Recent input:
<backspace> w <tab> <down> <down> <up> <return> C-e 
C-a ( s e t q SPC t i m e r - <M-backspace> r e d r 
a w - t i m e r SPC M-b M-b c r / C-e ( <backspace> 
C-e C-j C-x b <return> C-a C-SPC <up> <down> <down> 
C-w C-w C-x C-s <down-mouse-1> <mouse-1> <return> <return> 
<return> <up> 1 . SPC P r e p a r e SPC t h e SPC b 
u n d l e SPC t h a t SPC w i l l SPC b e SPC e x e 
c u t e d SPC M-x b l i <tab> c <tab> <return> <down> 
<up> C-a C-e C-a C-e <help-echo> M-x h l - l <tab> 
<return> <down> <down> <down> <up> <up> <up> <down> 
<down> <down> <down> <up> <up> <up> <up> <down-mouse-1> 
<mouse-1> <S-right> C-x b s c <return> ( C a n c <tab> 
<backspace> <backspace> <backspace> <backspace> c a 
c <backspace> n c <tab> <tab> t i <tab> SPC c r <tab> 
/ r <tab> <down> <down> <down> <down> <return> C-e 
C-j <up> <up> C-e C-j ( t i m e r <tab> C-a C-k t i 
m e r - l <tab> <tab> C-j ( r <backspace> s e t q SPC 
r e d <tab> <down> <down> <down> <return> <M-backspace> 
<M-backspace> r e d i <tab> <down> <down> <return> 
SPC t C-e C-j <S-left> <down> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> C-e <return> <return> <backspace> 
<backspace> <return> <return> <backspace> <backspace> 
<return> <return> <return> <return> <up> <up> <up> 
<down> <down> <up> <up> <delete> <delete> <delete> 
<up> C-e <down-mouse-1> <mouse-1> M-x r e p o r t - 
e m <tab> <return>

Recent messages:
byte-code: End of buffer
Auto-saving...done
Mark set
Saving file ****...
Wrote ****
Blink-Cursor mode enabled
Hl-Line mode enabled
Auto-saving...done
byte-code: End of buffer
Auto-saving...done

Load-path shadows:
/home/chrisros/.emacs.d/vendor/nxhtml/util/edit-server hides /home/chrisros/.emacs.d/elpa/edit-server-20121205.328/edit-server
/home/chrisros/.emacs.d/vendor/nxhtml/util/fold-dwim hides /home/chrisros/.emacs.d/elpa/fold-dwim-1.2/fold-dwim
/home/chrisros/.emacs.d/vendor/nxhtml/util/fold-dwim hides ~/.emacs.d/vendor/fold-dwim
/home/chrisros/.emacs.d/elpa/pymacs-0.25/pymacs hides ~/.emacs.d/vendor/pymacs
/home/chrisros/.emacs.d/vendor/nxhtml/util/ack hides ~/.emacs.d/vendor/ack
/home/chrisros/.emacs.d/vendor/nxhtml/web-vcs hides ~/.emacs.d/vendor/web-vcs
/home/chrisros/.emacs.d/vendor/nxhtml/util/tabkey2 hides ~/.emacs.d/vendor/tabkey2
~/.emacs.d/custom hides /home/chrisros/share/emacs/24.3/lisp/custom
/home/chrisros/.emacs.d/vendor/nxhtml/util/org-odt hides /home/chrisros/share/emacs/24.3/lisp/org/org-odt
/home/chrisros/.emacs.d/vendor/nxhtml/related/php-mode hides /home/chrisros/.emacs.d/vendor/php-mode-1.5.0/php-mode

Features:
(shadow sort mail-extr emacsbug message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils windmove rst
pcmpl-unix add-log which-func subword cus-edit wid-edit ropemacs pymacs
hi-lock imenu help-mode server highlight-parentheses diff-hl vc-dir ewoc
diff-mode cr-amazon cr-visual-niceties tempbuf fold-dwim hideshow
noutline outline hl-line cr-extensions custom-flymake cr-nxhtml jinja
mumamo rx flymake-files flymakemsg nxhtml-autostart nxhtml-autoload
majmodpri vc-git vc-p4 p4-lowlevel ediff-merg ediff-diff ediff-wind
ediff-help ediff-util ediff-mult ediff-init ediff vc vc-dispatcher
nxhtml-menu web-autoload nxhtml-base cr-yaml yaml-mode cr-shell-script
cr-perl cr-perl-debug-track perltidy cperl-mode cr-ruby custom-sql
sql-indent sql custom-org custom-shell custom-nxml custom-markdown
custom-js2 custom-lisp elisp-ext custom-dired custom-php cr-mediawiki
python-ide flymake ipython executable shell pcomplete python-mode
info-look info custom-text-mode cr-smerge custom-ibuffer ibuffer
custom-edit-server edit-server cr-gist pastebin gist xml custom-server
custom-vc custom-ansi-term term disp-table ehelp custom-OSX
custom-abbrev pabbrev thingatpt custom-yasnippet custom-keyboard
framemove custom-iswitchb custom-misc url-handlers iswitchb
custom-autocomplete warnings auto-complete-config auto-complete
custom-functions batch-mode erlang-start iedit browse-kill-ring ffap
url-parse auth-source eieio byte-opt bytecomp byte-compile cconv
gnus-util mm-util mail-prsvr password-cache url-vars zencoding-mode
pycov2 linum scratch ack derived compile comint ansi-color ring
dired-single pager pair-mode easy-mmode skeleton lorem-ipsum table
cr-packages diff-hl-autoloads finder-inf edit-server-autoloads
fill-column-indicator-autoloads fold-dwim-autoloads gist-autoloads
goto-last-change-autoloads highlight-parentheses-autoloads
magit-autoloads mediawiki-autoloads mode-compile-autoloads
notify-autoloads pymacs-autoloads rainbow-mode-autoloads
sunrise-x-buttons-autoloads sunrise-x-loop-autoloads
sunrise-x-mirror-autoloads sunrise-x-modeline-autoloads
sunrise-x-tabs-autoloads sunrise-x-tree-autoloads
sunrise-commander-autoloads undo-tree-autoloads yaml-mode-autoloads
yasnippet-bundle-autoloads yasnippet-bundle cl-macs gv dropdown-list
yasnippet edmacro kmacro easymenu assoc cl package cr-environment
cr-coding advice help-fns cl-lib advice-preload cr-utilities re-builder
time-date tomorrow-night-bright-theme paren whitespace autorevert
electric desktop cus-start cus-load 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 dynamic-setting system-font-setting
font-render-setting x-toolkit x multi-tty emacs)