From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Martin Pool Newsgroups: gmane.emacs.devel Subject: Re: suggested feature -- console-mode frame title sets Xterm title Date: Fri, 3 Oct 2003 11:04:05 +1000 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20031003010404.GB1259@sourcefrog.net> References: <87r8j9n6v4.fsf@blarg.net> <200206152147.g5FLlUB10968@aztec.santafe.edu> <20030929051617.GB7359@vexed.ozlabs.hp.com> <20031002063338.GA25969@vexed.ozlabs.hp.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1065143352 25264 80.91.224.253 (3 Oct 2003 01:09:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Oct 2003 01:09:12 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Oct 03 03:09:10 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A5ERS-0004uJ-00 for ; Fri, 03 Oct 2003 03:09:10 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A5ERQ-0008N0-00 for ; Fri, 03 Oct 2003 03:09:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A5ENm-0002WD-TT for emacs-devel@quimby.gnus.org; Thu, 02 Oct 2003 21:05:22 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1A5ENT-0002Vo-Fn for emacs-devel@gnu.org; Thu, 02 Oct 2003 21:05:03 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1A5EMu-0002TV-A1 for emacs-devel@gnu.org; Thu, 02 Oct 2003 21:04:59 -0400 Original-Received: from [210.9.142.32] (helo=emo.sourcefrog.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A5EMr-0002Sh-Aj for emacs-devel@gnu.org; Thu, 02 Oct 2003 21:04:25 -0400 Original-Received: by emo.sourcefrog.net (Postfix, from userid 500) id 128482690; Fri, 3 Oct 2003 11:04:05 +1000 (EST) Original-To: emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: X-GPG: 1024D/A0B3E88B: AFAC578F 1841EE6B FD95E143 3C63CA3F A0B3E88B User-Agent: Mutt/1.5.4i X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16892 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16892 On 2 Oct 2003, Richard Stallman wrote: > I think the only remaining problem is that this has changed the way > select-buffer-by-name works. > > I can't find any select-buffer-by-name in the Emacs sources. > Could you please explain what this is about? Sorry, I meant select-frame-by-name. > For multi-frame text terminals the names > used to be F%d, but now they're "full" names, probably including the > name of the buffer. > > I am confused. What are "the names"? >>From the emacs 21.3 manual: Non-Window Terminals ==================== If your terminal does not have a window system that Emacs supports, then it can display only one Emacs frame at a time. However, you can still create multiple Emacs frames, and switch between them. Switching frames on these terminals is much like switching between different window configurations. Use `C-x 5 2' to create a new frame and switch to it; use `C-x 5 o' to cycle through the existing frames; use `C-x 5 0' to delete the current frame. Each frame has a number to distinguish it. If your terminal can display only one frame at a time, the selected frame's number N appears near the beginning of the mode line, in the form `FN'. `FN' is actually the frame's name. You can also specify a different name if you wish, and you can select a frame by its name. Use the command `M-x set-frame-name NAME ' to specify a new name for the selected frame, and use `M-x select-frame-by-name NAME ' to select a frame according to its name. The name you specify appears in the mode line when the frame is selected. Before this patch, on non-window terminals, the f->name field is set to 'F%d' by default. This identifier also comes up near the left of the modeline through the mode-line-frame-identification variable and the '%F' format. This is why when you start "emacs-21.3 -q nw", you see the string "F1" to the left of the buffer name. (I always wondered why that was there...) Also in 21.3, the behaviour on window system frames is quite different: f->name contains what I think of as a "full name" for the window. It's produced by expanding the variable frame-title-format. This is by default "emacs@hostname" if there is one frame, or the buffer name if there is more than one. The frame name is usually used as the window title. You can also use select-frame-by-name here, but you need to choose a window title, not a short name like "F1". The problem is that the manual gives the impression that "each frame has a number to distinguish it", but in fact this is just a different default frame name. This patch makes frame-title-format apply to both window and non-window frames, so the frame titles are consistent between them. As a side effect it removes the special-case behaviour for frame names described in that section of the manual. In other words, with my current version of the patch, the first termcap frame is called "emacs@host", just as for the first window-system frame. So the functionality of switching between non window system frames still works, but the pattern names you choose from are different. > To avoid messing up the modeline I have disabled the %F character when > tty-frame-use-title is set. > > I am confused here too. What does any of this have to do with > the mode line? What would have "messed it up"? The '%F' format item shows the frame name in the modeline, and it is in there by default on non-window terminals. With this patch applied, the frame name follows frame-title-format, which is typically much longer than two characters. This causes the frame title to use up a lot of the space on the modeline. I say it's messed up because you might not be able to see, say, the line-number annunciator. If the buffer name is in the frame title then it's printed twice, once by %F and once by %b. This looks messy. -- mbp