From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.bugs Subject: Re: feature request: efficient support for dynamic GNU Screen window titles Date: Mon, 30 Apr 2007 09:04:38 +0900 Message-ID: <87hcqy4tih.fsf@catnip.gol.com> References: Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177891493 16168 80.91.229.12 (30 Apr 2007 00:04:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 30 Apr 2007 00:04:53 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: trentbuck@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 30 02:04:51 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 1HiJNr-0008Ux-01 for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Apr 2007 02:04:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HiJTy-0001GS-FC for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Apr 2007 20:11:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HiJTx-0001G4-0o for bug-gnu-emacs@gnu.org; Sun, 29 Apr 2007 20:11:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HiJTt-0001Df-GH for bug-gnu-emacs@gnu.org; Sun, 29 Apr 2007 20:11:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HiJTt-0001Dc-Bf for bug-gnu-emacs@gnu.org; Sun, 29 Apr 2007 20:11:05 -0400 Original-Received: from smtp02.dentaku.gol.com ([203.216.5.72]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HiJNj-0008Tl-SV; Sun, 29 Apr 2007 20:04:44 -0400 Original-Received: from 203-216-97-156.dsl.gol.ne.jp ([203.216.97.156] helo=catnip.gol.com) by smtp02.dentaku.gol.com with esmtpa (Dentaku) id 1HiJNh-00028U-E2; Mon, 30 Apr 2007 09:04:41 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id 8124F2F43; Mon, 30 Apr 2007 09:04:38 +0900 (JST) System-Type: i686-pc-linux-gnu In-Reply-To: (Trent Buck's message of "Sun\, 29 Apr 2007 04\:45\:37 +1000") Original-Lines: 31 X-Abuse-Complaints: abuse@gol.com X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:15686 Archived-At: "Trent Buck" writes: > 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. Of course it would be nice to have a more elegant method, but I suspect your method could be sped up a lot by keeping track of the last string you sent to the terminal, and only sending again when it changes. E.g.: (defvar last-sent-frame-title nil) (when (and (null window-system) (string-match "\\`screen" (getenv "TERM"))) (add-hook 'post-command-hook (lambda () (let ((title (format-mode-line frame-title-format))) (unless (equal title last-sent-frame-title) (send-string-to-terminal (concat "\ek" title "\e\\")) (setq last-sent-frame-title title)))))) This still incurs the overhead of `format-mode-line', but at least it avoids the actual I/O (which I expect is the main cause of slowness). -Miles -- We are all lying in the gutter, but some of us are looking at the stars. -Oscar Wilde