home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!corton!sophia!rhea.inria.fr!beust
- From: beust@rhea.inria.fr (Cedric Beust)
- Newsgroups: alt.lucid-emacs.help
- Subject: Setting the icon title properly
- Message-ID: <25943@sophia.inria.fr>
- Date: 30 Jul 92 15:05:42 GMT
- Sender: news@sophia.inria.fr
- Organization: University of Nice Sophia-Antipolis, France
- Lines: 49
-
-
- I want to write some elisp that would set the icon title with
- the name of the buffers. By setting the variable unmap-screen-hook,
- this seems to work fine for one screen but when I open a second
- screen, even though I give it another name, I can't seem to have
- two icons with distinct titles. The already iconified lemacs
- takes the title of the newly iconified one, so you can't
- distinguish one from the other.
-
- It seems the screen-icon-title-format variable doesn't act on
- a per-screen basis but is global to all screens. Did I miss
- something?
-
- Here is the code I wrote :
-
- (defun ced-make-string (l sep)
- "Given a list of string, return one string composed of all its elements
- separated by the string sep"
- (if l
- (concat (car l)
- (let ((result (ced-make-string (cdr l) sep)))
- (if result (concat sep result) "")))))
-
- (defun ced-squeeze-empty (l)
- "Given a list of strings, return the list with each empty string removed"
- (if l
- (if (equal (car l) "") (ced-squeeze-empty (cdr l))
- (cons (car l) (ced-squeeze-empty (cdr l))))))
-
-
- (defun ced-set-titles (screen) ;; (buffer &arg ignored)
- "Set the icon title according to the buffers currently displayed"
- (setq screen-icon-title-format
- (ced-make-string
- (ced-squeeze-empty
- (mapcar '(lambda (buffer)
- (if (get-buffer-window buffer)
- (buffer-name buffer)
- ""))
- (buffer-list)))
- ",")))
-
-
- (setq unmap-screen-hook 'ced-set-titles)
-
-
- --
- Cedric BEUST, beust@sa.inria.fr, Bull Research Koala proj, KoalaBus & xforum
- Pho:(33) 93.65.77.70(.66 Fax), INRIA, B.P.93 - 06902 Sophia Antipolis, FRANCE.
-