From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: myrkraverk@users.sourceforge.net Newsgroups: gmane.emacs.help Subject: Displaying the window number in the mode line? Date: Thu, 22 May 2003 01:14:36 +0000 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <16076.9340.643300.771365@jin.tekken> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1053567255 22576 80.91.224.249 (22 May 2003 01:34:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 22 May 2003 01:34:15 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu May 22 03:34:13 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19IeyD-0005rw-00 for ; Thu, 22 May 2003 03:34:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19IetI-0005gC-Qw for gnu-help-gnu-emacs@m.gmane.org; Wed, 21 May 2003 21:29:08 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19IejS-0003SM-AT for help-gnu-emacs@gnu.org; Wed, 21 May 2003 21:18:58 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19Ieiv-0003HH-Jx for help-gnu-emacs@gnu.org; Wed, 21 May 2003 21:18:56 -0400 Original-Received: from adsl1-61.du.heimsnet.is ([62.145.142.61] helo=jin.tekken) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Ieeu-00029d-2l for help-gnu-emacs@gnu.org; Wed, 21 May 2003 21:14:16 -0400 Original-Received: (from myrkraverk@localhost) by jin.tekken (8.11.6/8.11.6) id h4M1EaS10622; Thu, 22 May 2003 01:14:36 GMT X-Authentication-Warning: jin.tekken: myrkraverk set sender to myrkraverk@users.sourceforge.net using -f Original-To: help-gnu-emacs@gnu.org X-Mailer: VM 7.15 under Emacs 21.3.1 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:9993 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9993 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.