all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Juri Linkov <juri@jurta.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: On removing sequence_number from window structure
Date: Sun, 10 Feb 2013 14:33:41 +0100	[thread overview]
Message-ID: <5117A1B5.5090302@gmx.at> (raw)
In-Reply-To: <87r4kor0iy.fsf@mail.jurta.org>

 > 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



      reply	other threads:[~2013-02-10 13:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-02  8:50 On removing sequence_number from window structure martin rudalics
2013-02-02 17:32 ` Dmitry Antipov
2013-02-02 17:50   ` martin rudalics
2013-02-08  8:17 ` Juri Linkov
2013-02-08  9:55   ` Eli Zaretskii
2013-02-08  9:59   ` martin rudalics
2013-02-08 15:17     ` Stefan Monnier
2013-02-08 15:33       ` Drew Adams
2013-02-09  0:30     ` Juri Linkov
2013-02-09  9:21       ` martin rudalics
2013-02-09 14:20         ` Stefan Monnier
2013-02-09 17:08           ` martin rudalics
2013-02-10  9:57             ` Juri Linkov
2013-02-10 13:33               ` martin rudalics [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5117A1B5.5090302@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.