From: david.boon@gmail.com
Subject: change title bar, mode specific
Date: 13 Dec 2004 09:42:59 -0800 [thread overview]
Message-ID: <1102959778.975908.312770@c13g2000cwb.googlegroups.com> (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)
reply other threads:[~2004-12-13 17:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1102959778.975908.312770@c13g2000cwb.googlegroups.com \
--to=david.boon@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).