* change title bar, mode specific
@ 2004-12-13 17:42 david.boon
0 siblings, 0 replies; only message in thread
From: david.boon @ 2004-12-13 17:42 UTC (permalink / raw)
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-12-13 17:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-13 17:42 change title bar, mode specific david.boon
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.