From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: david.boon@gmail.com Newsgroups: gmane.emacs.help Subject: change title bar, mode specific Date: 13 Dec 2004 09:42:59 -0800 Organization: http://groups.google.com Message-ID: <1102959778.975908.312770@c13g2000cwb.googlegroups.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1102959906 28982 80.91.229.6 (13 Dec 2004 17:45:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Dec 2004 17:45:06 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 13 18:44:52 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CduFf-0002IB-00 for ; Mon, 13 Dec 2004 18:44:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CduPm-0004uC-5k for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Dec 2004 12:55:18 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!c13g2000cwb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-NNTP-Posting-Host: 66.133.138.130 Original-X-Trace: posting.google.com 1102959782 31514 127.0.0.1 (13 Dec 2004 17:43:02 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 13 Dec 2004 17:43:02 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: c13g2000cwb.googlegroups.com; posting-host=66.133.138.130; posting-account=qWIiRQ0AAADzG0er_50Td3DC9areuvGb Original-Xref: shelby.stanford.edu gnu.emacs.help:127283 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:22712 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:22712 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)