Do `emacs -Q', turn on global-font-lock-mode, and visit a long file --
say, `.emacs'. Now go back to the `*scratch*' buffer and evaluate the
following:

(defun check-buffer ()
  (if (not (eq (current-buffer) my-buffer))
      (message "Foo: %s" (buffer-name (current-buffer)))))

(setq my-buffer (current-buffer))
(run-with-timer 0.1 0.1 'check-buffer)

Wait for around five seconds. You will see:

Foo: .emacs

You need to have font-lock enabled, and there has to be a long fontified
buffer lurking around somewhere. My guess is that the font-lock engine is
doing stuff while waiting for input, which causes current-buffer to be
different when the timer calls the function.

This has the unfortunate consequence of breaking Pong.



_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to