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

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

Re: Displaying the window number in the mode line?


From: Oliver Scholz
Subject: Re: Displaying the window number in the mode line?
Date: Fri, 23 May 2003 11:25:32 +0200
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt)

address@hidden writes:
[...]
> 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))
[...]

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

    Oliver
-- 
4 Prairial an 211 de la Révolution
Liberté, Egalité, Fraternité!


reply via email to

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