help-gnu-emacs
[Top][All Lists]
Advanced

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

Displaying the window number in the mode line?


From: myrkraverk
Subject: Displaying the window number in the mode line?
Date: Thu, 22 May 2003 01:14:36 +0000

Hi,

I've made a crude hack to jump to a window with specific number, the
functions are available at

  http://www.emacswiki.org/cgi-bin/wiki.pl?SwitchingWindows

and have been revised a little by better elisp hackers than me :)

This has resulted in my desire to display the window[1] number in the
mode line.  So far I've the following function to evalute the number
of the selected window:

(defun my-window-number ()
  (number-to-string
   (1- (length (memq (selected-window) (nreverse
                                        (window-list)))))))

Then I create this list with items I want to show in the modeline:

(setq window-number-string
      (list "W"
        '(:eval (my-window-number)) " "))

And add it to the global-mode-string:

(add-to-list 'global-mode-string '("" window-number-string))

But I only get an "W " in the modeline, the number doesn't show up!
Can anyone tell my why this is and how to do it?

And so people won't get confused, I'm using GNU Emacs version 21.[23].


Thanks in advange,

Johann

1 Emacs terminology, this has nothing to do with an os or even a
  window system. 




reply via email to

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