From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: On removing sequence_number from window structure Date: Sun, 10 Feb 2013 11:57:10 +0200 Organization: JURTA Message-ID: <87r4kor0iy.fsf@mail.jurta.org> References: <510CD342.8090600@gmx.at> <87obfvz0bp.fsf@mail.jurta.org> <5114CC9C.9040204@gmx.at> <87sj56cp8c.fsf@mail.jurta.org> <51161506.40702@gmx.at> <51168276.9070106@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1360490719 25356 80.91.229.3 (10 Feb 2013 10:05:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Feb 2013 10:05:19 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 10 11:05:39 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U4Tn1-0001Gt-03 for ged-emacs-devel@m.gmane.org; Sun, 10 Feb 2013 11:05:39 +0100 Original-Received: from localhost ([::1]:55828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4Tmh-0004gz-MK for ged-emacs-devel@m.gmane.org; Sun, 10 Feb 2013 05:05:19 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4Tmd-0004Xf-Mt for emacs-devel@gnu.org; Sun, 10 Feb 2013 05:05:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4Tmc-0008E2-BP for emacs-devel@gnu.org; Sun, 10 Feb 2013 05:05:15 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:51103 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4Tmc-0008AO-5H for emacs-devel@gnu.org; Sun, 10 Feb 2013 05:05:14 -0500 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id C04B6201A46727; Sun, 10 Feb 2013 02:05:10 -0800 (PST) In-Reply-To: <51168276.9070106@gmx.at> (martin rudalics's message of "Sat, 09 Feb 2013 18:08:06 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 69.163.218.105 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156941 Archived-At: > Window parameters mean that one has to externally manage some sort of > mechanism to assign unique identifiers (strings or numbers) and run on > `window-configuration-change-hook' first a function to detect for each > split the new parent window and the new live window and assign them > the appropriate values. This is just 10 lines of code: (defvar window-identification-count 0) (defvar window-identification-table (make-hash-table :weakness 'key :test 'eq)) (defun window-identification-update () (walk-windows (lambda (w) (or (gethash w window-identification-table) (puthash w (setq window-identification-count (1+ window-identification-count)) window-identification-table))))) (add-hook 'window-configuration-change-hook 'window-identification-update) (defun mode-line-window-control () (format "-W%s " (or (gethash (selected-window) window-identification-table) ""))) (defvar mode-line-window-identification '(:eval (mode-line-window-control))) (put 'mode-line-window-identification 'risky-local-variable t) ;; Insert between mode-line-frame-identification and mode-line-buffer-identification (setcdr (nthcdr 6 mode-line-format) (cons 'mode-line-window-identification (nthcdr 7 mode-line-format)))