From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Dyballa Newsgroups: gmane.emacs.help Subject: Re: ~/.emacs_bash setting PS1 Date: Tue, 5 Feb 2008 10:25:40 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1202203575 9304 80.91.229.12 (5 Feb 2008 09:26:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Feb 2008 09:26:15 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Samuel Karl Peterson Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 05 10:26:37 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JMK4Y-0004kJ-KP for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Feb 2008 10:26:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMK46-0003i9-6H for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Feb 2008 04:26:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMK3l-0003fa-D3 for help-gnu-emacs@gnu.org; Tue, 05 Feb 2008 04:25:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMK3j-0003cO-RH for help-gnu-emacs@gnu.org; Tue, 05 Feb 2008 04:25:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMK3j-0003cF-N8 for help-gnu-emacs@gnu.org; Tue, 05 Feb 2008 04:25:43 -0500 Original-Received: from fmmailgate03.web.de ([217.72.192.234]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JMK3j-0003T3-FU for help-gnu-emacs@gnu.org; Tue, 05 Feb 2008 04:25:43 -0500 Original-Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate03.web.de (Postfix) with ESMTP id E2F02CDC9502; Tue, 5 Feb 2008 10:25:42 +0100 (CET) Original-Received: from [195.4.207.204] (helo=[192.168.1.2]) by smtp05.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.109 #226) id 1JMK3i-00017G-00; Tue, 05 Feb 2008 10:25:42 +0100 In-Reply-To: X-Mailer: Apple Mail (2.753) X-Sender: Peter_Dyballa@web.de X-Provags-ID: V01U2FsdGVkX1/pMbca3Tw1bsGMoxotQaCjFPapRoWalkFPLC5J tvhaaHfWq049OBRDdpdWtXkGr89HBrguQbfMnMiKMSRyJeYtW1 2LUhq0a2orxhIBntkVgQ== X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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: news.gmane.org gmane.emacs.help:51218 Archived-At: Am 05.02.2008 um 02:41 schrieb Samuel Karl Peterson: > However, placing the above line into the ~/.emacs_bash > file doesn't seem to work. It can't work because shell-mode does not support ANSI code in the prompt. Even if you enable some ANSI-fication with (ansi-color-for-comint-mode-on) it won't. What you can do is to set in the customisation sections (variables and faces) of your user init file (~/.emacs) your prompts' looks (here for a prompt that will look like "pete 1234 /\ "): '(comint-prompt-regexp "^[a-z]+ [0-9]+ /\\\\ " t) '(shell-prompt-pattern "^[a-z0-9]+ [0-9]+ /\\\\ ") '(comint-highlight-prompt ((t (:background "FloralWhite" :foreground "DarkViolet" :weight bold :family "-*- courier new-medium-r-*-10646-1")))) '(minibuffer-prompt ((t (:background "yellow" :foreground "dark red" :weight bold)))) If you're using *one* user init file for a handful of hosts you would need to put some ELisp code into the customisation to make GNU Emacs distinguish between the hosts and prompts. BTW, you can also choose different colours for background, foreground, fringes ... that's what I prefer. This can partly also be done by ~/.Xdefaults-. -- Greetings Pete When people run around and around in circles we say they are crazy. When planets do it we say they are orbiting.