[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mode-line-format - local variableness

From: Drew Adams
Subject: mode-line-format - local variableness
Date: Sun, 5 Apr 2009 15:18:37 -0700

(defun foo (text &optional buffer)
  "Display TEXT in BUFFER's mode line for 2 sec."
  (with-current-buffer (or buffer (current-buffer))
    (let ((mode-line-format  text))
      (force-mode-line-update) (sit-for 2))

M-: (foo "JJJJJ" "*scratch*")

In Emacs 20, JJJJJ is displayed in the mode-line of buffer *scratch* only. The
mode lines of other buffers are unaffected.

In Emacs 21 and later, *each* buffer's mode-line shows JJJJJ.

What am I missing? `mode-line-format' is a buffer-local variable. That makes me
think the Emacs 20 behavior is correct and the behavior since then is incorrect.
I assume I must be missing something here. Can someone please clue me in? Thx.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]