From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: On removing sequence_number from window structure Date: Sun, 10 Feb 2013 14:33:41 +0100 Message-ID: <5117A1B5.5090302@gmx.at> 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> <87r4kor0iy.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1360503242 24510 80.91.229.3 (10 Feb 2013 13:34:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Feb 2013 13:34:02 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 10 14:34:23 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 1U4X2y-0000lS-H1 for ged-emacs-devel@m.gmane.org; Sun, 10 Feb 2013 14:34:20 +0100 Original-Received: from localhost ([::1]:48878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4X2e-0004Yc-In for ged-emacs-devel@m.gmane.org; Sun, 10 Feb 2013 08:34:00 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4X2a-0004YN-K6 for emacs-devel@gnu.org; Sun, 10 Feb 2013 08:33:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4X2Y-0001TS-3C for emacs-devel@gnu.org; Sun, 10 Feb 2013 08:33:55 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:53556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4X2X-0001Sm-Pl for emacs-devel@gnu.org; Sun, 10 Feb 2013 08:33:54 -0500 Original-Received: from mailout-de.gmx.net ([10.1.76.2]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0M4EkX-1UuR4O22S3-00rm2f for ; Sun, 10 Feb 2013 14:33:51 +0100 Original-Received: (qmail invoked by alias); 10 Feb 2013 13:33:51 -0000 Original-Received: from 62-47-49-219.adsl.highway.telekom.at (EHLO [62.47.49.219]) [62.47.49.219] by mail.gmx.net (mp002) with SMTP; 10 Feb 2013 14:33:51 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/E4Sox6sfE0YUqKkySIdbY9z7QjP5ZPa0iry3LiO TQCvFeVW2VSqn2 In-Reply-To: <87r4kor0iy.fsf@mail.jurta.org> X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.20 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:156943 Archived-At: > This is just 10 lines of code: Not counting those we'd need for print.c. Look at the checks for printing frame names. > (defvar window-identification-count 0) This is the global variable I'd have to maintain externally. > (defvar window-identification-table (make-hash-table :weakness 'key :test 'eq)) OT1H you propose using a hash table ... > (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))))) ... and OTOH you simply increment `window-identification-count' as in the sequence numbers approach which makes this unsuitable for users who wanted to use window ids as prefix arguments for window selection. > (add-hook 'window-configuration-change-hook 'window-identification-update) Just that if I run something on `window-configuration-change-hook' before `window-identification-update' I'm lost. And anything I run in between `split-window-internal' and `run-window-configuration-change-hook' doesn't have the new numbers yet. But I think we could unify your approach with sequence numbers: If the customizble function `set-window-id' is not set, use classic sequence numbers with their C counter. This would be useful for debugging and with emacs -Q. For getting a useful prefix argument (which should never change for one and the same window) `set-window-id' would use the first unassigned key (this is not suitable for debugging since since if GC happens in the middle of a trace, you could get the impression that two windows are the same whereas the first of them has been deleted before the GC and the second one has been created after it). Obviously, if GC is rare, window ids might grow large but if we don't assign low numbers to internal windows this should be less critical. martin