unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* feature request: efficient support for dynamic GNU Screen window titles
@ 2007-04-28 18:45 Trent Buck
  0 siblings, 0 replies; 3+ messages in thread
From: Trent Buck @ 2007-04-28 18:45 UTC (permalink / raw)
  To: bug-gnu-emacs; +Cc: trentbuck


[-- Attachment #1.1: Type: text/plain, Size: 2296 bytes --]

[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.

From [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")))

...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

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-30  5:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2697.1177883376.7795.bug-gnu-emacs@gnu.org>
2007-04-30  0:04 ` feature request: efficient support for dynamic GNU Screen window titles Miles Bader
2007-04-30  5:45   ` Trent Buck
2007-04-28 18:45 Trent Buck

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).