Thread View: gnu.epoch.misc
6 messages
6 total messages
Started by Brian L. Kahn
Wed, 05 Aug 1992 14:44
Screen titles (elisp code)
Author: Brian L. Kahn
Date: Wed, 05 Aug 1992 14:44
Date: Wed, 05 Aug 1992 14:44
21 lines
1016 bytes
1016 bytes
This does a pretty good job, with occasional mistakes:
----------------------
(defun ep:do-titles (win)
"Do screen title, WIN currently selected."
;; change screen title if new name, not minibuf
(let ((scr (buffer-name (window-buffer win))))
(if (not (string-equal (title) scr))
(if (not (string-match "Minibuf" scr))
(title scr)
))))
(setq set-window-buffer-hook
(func (win) (ep:do-titles win)))
(setq window-select-hook
(func (win) (ep:do-titles win)))
--
B< Brian Kahn blk@security.mitre.org "may the farce be with you"
Screen titles (elisp code)
Author: Marc Andreessen
Date: Wed, 05 Aug 1992 05:02
Date: Wed, 05 Aug 1992 05:02
24 lines
1233 bytes
1233 bytes
This does a pretty good job, with occasional mistakes:
----------------------
(defun ep:do-titles (win)
"Do screen title, WIN currently selected."
;; change screen title if new name, not minibuf
(let ((scr (buffer-name (window-buffer win))))
(if (not (string-equal (title) scr))
(if (not (string-match "Minibuf" scr))
(title scr)
))))
(setq set-window-buffer-hook
(func (win) (ep:do-titles win)))
(setq window-select-hook
(func (win) (ep:do-titles win)))
--
B< Brian Kahn blk@security.mitre.org "may the farce be with you"
window-select-hook (contributed by Brian) will be in 4.1 :-).
Marc
Screen titles (elisp code)
Author: Jose E. Hernandez
Date: Wed, 05 Aug 1992 16:01
Date: Wed, 05 Aug 1992 16:01
11 lines
765 bytes
765 bytes
I am still using epoch3.2, but I was able to get the code to work by making
the following changes:
(setq set-window-buffer-hook
(function (lambda (win) (ep:do-titles win))))
(setq window-select-hook
(function (lambda (win) (ep:do-titles win))))
It works great, thank you!
Screen titles (elisp code)
Author: Jim Thompson
Date: Wed, 05 Aug 1992 16:18
Date: Wed, 05 Aug 1992 16:18
37 lines
1867 bytes
1867 bytes
Thanks to Brian for distributing his do-titles; I'd been wanting
something like it, but didn't have time to write it. I did, however,
take the time to make a couple of quick hacks to Brian's code:
First, "func" wasn't recognized as a proper function by my epoch (is
that a local thing, Brian, or is my epoch screwed?); I replaced "(func ..."
with "'(lambda ..." and it works fine.
Second, I wanted "@ hostname" to appear in the window title.
Finally, I wanted the icon-name to change also.
These were fairly simple and all seem to work well; here's the hacked
version, for anyone who's interested:
(defun ep:do-titles (win)
"Chnage screen title and icon name, WIN currently selected."
;; change screen title if new name, not minibuf
(let ((scr (concat (buffer-name (window-buffer win)) " @ " (system-name))))
(if (not (string-equal (title) scr))
(if (string-match "Minibuf" scr)
nil
(icon-name scr)
(title scr)))))
(setq set-window-buffer-hook
'(lambda (win) (ep:do-titles win)))
(setq window-select-hook
'(lambda (win) (ep:do-titles win)))
Jim
--
_ Jim Thompson | Western Geophysical
_| ~- thompson@wg2.waii.com | Exploration Products
\, _} jimt@sugar.neosoft.com | 3600 Briarpark
\( (713) 964-6213 | Houston, TX 77042
Re: Screen titles (elisp code)
Author: Phil Johnson
Date: Tue, 25 Aug 1992 21:03
Date: Tue, 25 Aug 1992 21:03
34 lines
1862 bytes
1862 bytes
(Sorry for all the included text which follows -- I hate it when people do this! -- but this thread is a bit stale.) Jim Thompson (thompson@wg2.waii.com) writes: > Thanks to Brian for distributing his do-titles; I'd been wanting > something like it, but didn't have time to write it. I did, however, > take the time to make a couple of quick hacks to Brian's code: . . . > (defun ep:do-titles (win) > "Chnage screen title and icon name, WIN currently selected." > ;; change screen title if new name, not minibuf > (let ((scr (concat (buffer-name (window-buffer win)) " @ " (system-name)))) > (if (not (string-equal (title) scr)) > (if (string-match "Minibuf" scr) > nil > (icon-name scr) > (title scr))))) > > (setq set-window-buffer-hook > '(lambda (win) (ep:do-titles win))) > > (setq window-select-hook > '(lambda (win) (ep:do-titles win))) Jim's (and Brian's) code works fine for me, with a small problem: when doing find-file-other-screen from another screen, the old screen's title bar is updated before the new screen's. So you end up with two screens labeled with the name of the new buffer. (The old one will be fixed when you move the cursor back into it.) Is there an easy fix for this? - Phil
Re: Screen titles (elisp code)
Author: Brian L. Kahn
Date: Wed, 26 Aug 1992 13:57
Date: Wed, 26 Aug 1992 13:57
13 lines
917 bytes
917 bytes
Here is a fix for do-titles that works with find-file-other-screen: change < (icon-name scr) < (title scr) to > (icon-name scr (screen-of-window win)) > (title scr (screen-of-window win)) -- B< Brian Kahn blk@security.mitre.org "may the farce be with you"
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads