unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: emacs-pretest-bug@gnu.org, permezel@mac.com,
	monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: should frame names be unique?
Date: Sat, 22 Mar 2008 11:50:11 +0200	[thread overview]
Message-ID: <ubq57gka4.fsf@gnu.org> (raw)
In-Reply-To: <002801c88bc5$4111c180$0600a8c0@us.oracle.com>

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Fri, 21 Mar 2008 19:34:28 -0700
> Cc: emacs-pretest-bug@gnu.org, 'Damon Permezel' <permezel@mac.com>,
> 	'Emacs-Devel' <emacs-devel@gnu.org>
> 
> > > 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	other threads:[~2008-03-22  9:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11  3:41 difficulty creating unique frame names Damon Permezel
2008-03-21 15:40 ` should frame names be unique? [was: difficulty creating unique frame names] Drew Adams
2008-03-21 18:23   ` should frame names be unique? Stefan Monnier
2008-03-21 20:28     ` Drew Adams
2008-03-22  1:12       ` Stefan Monnier
2008-03-22  1:58         ` Damon Permezel
2008-03-22 16:55           ` Stefan Monnier
2008-03-22 18:12             ` Drew Adams
2008-03-23  0:47               ` Stefan Monnier
2008-03-22  2:34         ` Drew Adams
2008-03-22  9:50           ` Eli Zaretskii [this message]
2008-03-22 15:38             ` Drew Adams
2008-03-22 17:29               ` Eli Zaretskii
2008-03-22  1:43       ` Damon Permezel
2008-03-22  9:51         ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=ubq57gka4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=permezel@mac.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).