From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Trent Buck" Newsgroups: gmane.emacs.bugs Subject: feature request: efficient support for dynamic GNU Screen window titles Date: Sun, 29 Apr 2007 04:45:37 +1000 Message-ID: <20070428184537.GA9872@baal.lan> Reply-To: trentbuck@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0053231886==" X-Trace: sea.gmane.org 1177883004 26302 80.91.229.12 (29 Apr 2007 21:43:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 Apr 2007 21:43:24 +0000 (UTC) Cc: trentbuck@gmail.com To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 29 23:43:21 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HiHAr-0005vo-Nz for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Apr 2007 23:43:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HiHGy-0001qD-Gr for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Apr 2007 17:49:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hhs1U-0002v3-6r for bug-gnu-emacs@gnu.org; Sat, 28 Apr 2007 14:51:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hhs1S-0002uo-FO for bug-gnu-emacs@gnu.org; Sat, 28 Apr 2007 14:51:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hhs1S-0002uj-90 for bug-gnu-emacs@gnu.org; Sat, 28 Apr 2007 14:51:54 -0400 Original-Received: from omta04ps.mx.bigpond.com ([144.140.83.156]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HhrvS-00068e-CB for bug-gnu-emacs@gnu.org; Sat, 28 Apr 2007 14:45:42 -0400 Original-Received: from oaamta04ps.mx.bigpond.com ([155.143.223.85]) by omta04ps.mx.bigpond.com with ESMTP id <20070428184539.BWYE15631.omta04ps.mx.bigpond.com@oaamta04ps.mx.bigpond.com>; Sat, 28 Apr 2007 18:45:39 +0000 Original-Received: from ares.lan ([155.143.223.85]) by oaamta04ps.mx.bigpond.com with ESMTP id <20070428184539.QKLW13245.oaamta04ps.mx.bigpond.com@ares.lan>; Sat, 28 Apr 2007 18:45:39 +0000 Original-Received: from baal.lan (rocinante.lan [192.168.1.3]) by ares.lan (Postfix) with SMTP id A7514BB7D4; Sun, 29 Apr 2007 04:45:37 +1000 (EST) Original-Received: by baal.lan (sSMTP sendmail emulation); Sun, 29 Apr 2007 04:45:37 +1000 User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: Solaris 8 (2) X-Mailman-Approved-At: Sun, 29 Apr 2007 17:49:35 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:15685 Archived-At: --===============0053231886== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [I'm currently using CVS GNU Emacs; I'm not using emacs-pretest-bug because it's not release critical. I hope that's the Right Thing.] I use GNU Screen as both a window system and a window manager. Screen allows client windows to change their window title by emitting a specially crafted escape sequence, like so: (send-string-to-terminal (concat "\ek" (format-mode-line frame-title-format) "\e\\")) I found that the following can be used to update the window title: (when (and (null window-system) (string-match "\\`screen" (getenv "TERM"))) (add-hook 'post-command-hook (lambda () (send-string-to-terminal (concat "\ek" (format-mode-line frame-title-format) "\e\\"))))) Unfortunately, this means that every time ANY command is run, Emacs prints a string to the controlling terminal. For example, with the above hook in place, copying a paragraph of text from another Screen window into Emacs' window is significantly slower and produces lots of flicker. On my 1.6GHz Sempron system, it's UNUSABLY slow. =46rom [0] and [1], it appears that there is no more appropriate hook. The analogous code for setting the X window title is implemented in C, in xdisp.c (x_consider_frame_title). Is it possible to implement efficient updating of the Screen window title in lisp (i.e. in my .emacs)? If not, the C core will need patching to support this (right?), and I don't speak C. PS: I also tried using the :eval feature: (setq frame-title-format '(:eval (progn (shell-command "touch /tmp/zappo") (send-string-to-terminal (concat "\ek" (format-mode-line "%b") "\e\\")) "%b"))) =2E..but this didn't seem to have any effect whatsoever, possibly because frame-title-format is currently only used when Emacs is compiled with X support (#ifdef HAVE_WINDOW_SYSTEM). (The shell-command form is a kludgy way of determining if the form is ever evaluated.) [0] http://lists.gnu.org/archive/html/emacs-devel/2006-03/msg00909.html [1] http://groups.google.com/group/gnu.emacs.bug/msg/d578877c3a084d84 --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGM5ZRLpef9iTtxAYRArCGAJ0eucOHzjik9IYOqdBNb8OXOTko+gCg4ax8 46If+ZHIYvJdh8R8Tip0nFo= =IMpb -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs-- --===============0053231886== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ bug-gnu-emacs mailing list bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs --===============0053231886==--