Subject: 23.0.90; org-mode + viper-mode + ns make typing unresponsive

From: Steve Purcell <[email-masked]>
Date: Fri, 20 Feb 2009 15:16:52 +0100

Typing into an org buffer becomes very unresponsive under viper-mode.  
The input cursor flickers rapidly between windows, and entered  
characters are not immediately displayed.

I could not reproduce this bug via "emacsclient -t" -- it appears to  
affect only my Emacs' main NS frame.

How to reproduce:

Fire up emacs with -q.

Start viper-mode (M-x viper-mode, then 'n', '5', 'n').

Open an org document.  Split the window, e.g. with C-x 2, so that the  
org doc is in one window, and a different buffer (e.g. *scratch*) is  
in the other window.  You'll need to "M-x viper-mode" in the *scratch*  
buffer to flip it into viper mode too.

Now, enter insert mode in *scratch* (i) and type a few words.  The  
typing should be responsive, with no cursor flicker.

Now switch to the org buffer and try the same.  The typing becomes  
unresponsive, with a delay before the characters/words appear, and the  
cursor will flicker rapidly between the two buffers.

The lack of responsiveness has caused me to give up on CVS Emacs for  
now, since I'm so reliant on org-mode, and although I looked briefly  
in the org code for a possible cause, I didn't discover anything.

I've observed the flickering from non-org buffers, but not to the same  
extent, and I haven't detected a pattern.

If I remember correctly, this started sometime in January; I update my  
Emacs and Org from CVS/git almost daily, so either could be at fault.

In GNU Emacs 23.0.90.1 (i386-apple-darwin9.6.0, NS apple-appkit-949.43)
  of 2009-02-20 on mandala.as24.local
Windowing system distributor `Apple', version 10.3.949
configured using `configure  '--with-ns''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: en_US.UTF-8
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: en_US
   value of $XMODIFIERS: nil
   locale-coding-system: utf-8-unix
   default-enable-multibyte-characters: t

Major mode: Help

Minor modes in effect:
   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
   global-auto-composition-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t
   view-mode: t

Recent input:

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
Loading url...done
Loading vc-git...done
View mode: type C-h for help, h for commands, q to quit.
Buffer is read-only: #<buffer HELLO>
Type C-x 1 to delete the help window.
Quit
Making completion list... [3 times]