emacs-devel
[Top][All Lists]
Advanced

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

Re: should frame names be unique?


From: Eli Zaretskii
Subject: Re: should frame names be unique?
Date: Sat, 22 Mar 2008 11:50:11 +0200

> From: "Drew Adams" <address@hidden>
> Date: Fri, 21 Mar 2008 19:34:28 -0700
> Cc: address@hidden, 'Damon Permezel' <address@hidden>,
>       'Emacs-Devel' <address@hidden>
> 
> > > Yes, both. Though select-frame-by-name apparently removes
> > > duplicates, so AFAICT it doesn't even let you select some of
> > > the frames (a bug?).

I don't see duplicate removal in select-frame-by-name; can you point
me to what I'm missing here?

> > Not a bug: a fundamental limitation of the command: you can't 
> > select by name and at the same time distinguish between two
> > objects that have the same name.

Yes, select-frame-by-name assumes the frame names are unique.

> That's just describing the bug/limitation (the status quo)! That's exactly the
> point.

select-frame-by-name was written for use primarily on text terminals,
where the default Fn names (where n is a number) are not helpful when
you have several frames.  To remedy that, I modified set-frame-name
and its subroutines to allow setting the frame name on a tty to a
meaningful name.  My thoughts were that, since a human is expected to
give frames their names, which should be meaningful (or else they will
not be helpful), she (the said human) will take care of naming them
uniquely.  The only problem I had to deal with was the potential
clashes with the default Fn naming scheme.  Which is why
frame.c:set_term_name refuses to let you give a frame a name such as
F42.

select-frame-by-name works for GUI frames as well, but IMO it doesn't
make much sense there, since (a) several frames can be seen at once,
and (b) better ways of selecting the right frame by GUI features, such
as the mouse or task bar, are available.

Now, if the above assumptions are somehow wrong, there should be no
problem to force unique frame names inside x_set_name, similar to what
set_term_frame_name does for tty frames, either by uniquifying them
like we do with buffers (but I personally dislike the resulting foo<2>
names), or by requesting that the caller provides another name.




reply via email to

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