[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
change title bar, mode specific
From: |
david . boon |
Subject: |
change title bar, mode specific |
Date: |
13 Dec 2004 09:42:59 -0800 |
User-agent: |
G2/0.2 |
I've come up with the following lisp functions that change the
frame-title-format to the current working directory when in "Shell"
mode, but leave the frame-title-format as the file name when in other
modes. This approach has the unintended affect of changing the title
bar to be the current working directory in other modes if there is a
long running command in the shell mode. Questions are, 1) how to make
reset-frame-title-format only change the title bar when the Shell mode
is active, or the currently selected buffer. 2) I'm sure there is an
easier way to do what I've tried, ideas are welcome.
Thanks
(defun my-dirtrack-hook (arg)
"directory tracking hook"
(reset-frame-title-format)
arg)
(defun reset-frame-title-format? ()
"reset the frame title"
(if (string-match "Shell" mode-name)
(setq frame-title-format (concat "%b " default-directory))
(setq frame-title-format "%b %+%+ %f")))
(add-hook 'post-command-hook 'reset-frame-title-format)
(defun my-shell-setup ()
"My shell-setup hook"
(setq comint-completion-addsuffix t
w32-quote-process-args ?\"
comint-input-ignoredups t
comint-eol-on-send t)
(add-hook 'comint-output-filter-functions
'my-dirtrack-hook
nil ; append
nil ; local
)
(make-variable-buffer-local 'comint-completion-addsuffix))
(add-hook 'shell-mode-hook 'my-shell-setup)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- change title bar, mode specific,
david . boon <=