Thread View: gnu.epoch.misc
2 messages
2 total messages
Started by Brett McCoy
Mon, 08 Apr 1991 00:20
changing titles of screens
Author: Brett McCoy
Date: Mon, 08 Apr 1991 00:20
Date: Mon, 08 Apr 1991 00:20
14 lines
1347 bytes
1347 bytes
How does one go about changing the title of a screen in epoch? I have figured out how to create a screen with a particular title, but once the screen has been created I can't figure out how to change the title. What I am really looking for is a way to make the title of the screen reflect the current buffer that is being displayed instead of always displaying the name of the buffer that was being displayed when the screen was created. Any help would be appreciate. -- Brett McCoy Computing and Telecommunications Activities brtmac@maverick.ksu.ksu.edu Kansas State University Alcohol is a calibration reference device for finding an attitude parallel to the local horizon at ankle level.
Re: changing titles of screens
Author: Simon Kaplan
Date: Mon, 08 Apr 1991 03:33
Date: Mon, 08 Apr 1991 03:33
101 lines
4062 bytes
4062 bytes
You do this by setting the property "WM_NAME" using set-property.
Similarly, use WM_ICON_NAME to get icon names.
Here is a file of mine, maintain-screen-titles.el, that sort of does this.
use ^Z-a to resync titles when necessary. It misses buffer changes under
some circumstances, unfortunately. I cant remember who wrote this code
initially: either myself or Alan, I think.
;; have screens rename on the following actions: they get the current name
;; of the buffer.
;;
;; ^Xo
;; ^X0
;; ^x4b
;; ^x^f
;; ^x4^f
;; ^x1
;; ^xb
;; ^xk
(setq buffer-names-as-titles t)
(defvar inviolate-names '("Mh-Rmail" "Calendar" "Gnus"))
(defun memq-string-list (name list)
(cond ((null list) nil)
((string= name (car list)) (car list))
(t (memq-string-list name (cdr list)))))
(defun rename-screen (&optional name)
(interactive)
(let ((curr-scr-name (epoch::get-property "WM_NAME")))
(if (not (memq-string-list curr-scr-name inviolate-names))
(progn
(epoch::set-property "WM_NAME" (or name (concat (buffer-name)
(sys-name))))
(epoch::set-property "WM_ICON_NAME" (epoch::get-property "WM_NAME"))))))
(rename-screen) ;; rename first screen to match
(defun my-other-window (&optional count)
(interactive "p")
"Like other-window but renames screen to reflect current buffer"
(other-window count)
(rename-screen))
(defun my-delete-window (&optional window)
(interactive)
"Like delete-window but renames screen to reflect current buffer"
(delete-window window)
(rename-screen))
(defun my-switch-to-buffer-other-window ()
(interactive)
"Like switch-to-buffer-other-window but renames screen to reflect current buffer"
(command-execute 'switch-to-buffer-other-window)
(rename-screen))
(defun my-find-file (&optional filename)
(interactive "FFind file: ")
"Like find-file but renames screen to reflect current buffer"
(find-file filename)
(rename-screen))
(defun my-find-file-other-window (&optional filename)
(interactive "FFind file: ")
"Like find-file-other-window but renames screen to reflect current buffer"
(find-file-other-window filename)
(rename-screen))
(defun my-delete-other-windows (&optional window)
(interactive)
"Like delete-other-windows but renames screen to reflect current buffer"
(delete-other-windows window)
(rename-screen))
(defun my-switch-to-buffer ()
(interactive)
(command-execute 'switch-to-buffer)
(rename-screen))
(defun my-kill-buffer (&optional buffer)
(interactive "bKill Buffer ")
(kill-buffer buffer)
(rename-screen))
(global-set-key "\C-xk" 'my-kill-buffer)
(global-set-key "\C-xb" 'my-switch-to-buffer)
(global-set-key "\C-xo" 'my-other-window)
(global-set-key "\C-x0" 'my-delete-window)
(global-set-key "\C-x4b" 'my-switch-to-buffer-other-window)
(global-set-key "\C-x\C-f" 'my-find-file)
(global-set-key "\C-x4\C-f" 'my-find-file-other-window)
(global-set-key "\C-x1" 'my-delete-other-windows)
(global-set-key "\C-za" 'rename-screen)
--
Simon Kaplan kaplan@cs.uiuc.edu
Department of Computer Science uiucdcs!kaplan@uunet.uu.net
University of Illinois at Urbana-Champaign
1304 W. Springfield Ave phone: +1 217 244 0392
Urbana Illinois 61801, USA fax: +1 217 333 3501
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