unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Peter Dyballa <Peter_Dyballa@Web.DE>
To: Samuel Karl Peterson <skpeterson@nospam.please.ucdavis.edu>
Cc: help-gnu-emacs@gnu.org
Subject: Re: ~/.emacs_bash setting PS1
Date: Tue, 5 Feb 2008 10:25:40 +0100	[thread overview]
Message-ID: <E21C1D9A-9155-49FA-B52D-A2F297B2B387@Web.DE> (raw)
In-Reply-To: <o368x20w56y.fsf@pc14.cs.ucdavis.edu>


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-<hostname>.

--
Greetings

   Pete

When people run around and around in circles we say they are crazy.  
When planets do it we say they are orbiting.






  parent reply	other threads:[~2008-02-05  9:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-05  1:41 ~/.emacs_bash setting PS1 Samuel Karl Peterson
2008-02-05  9:09 ` Sven Joachim
2008-02-05 15:44   ` Samuel Karl Peterson
2008-02-05  9:25 ` Peter Dyballa [this message]
2008-02-05 10:27 ` Ehud Karni
2008-02-06 15:05 ` Stefan Monnier
2008-02-06 17:32   ` Samuel Karl Peterson
2008-02-08  2:57     ` Stefan Monnier

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=E21C1D9A-9155-49FA-B52D-A2F297B2B387@Web.DE \
    --to=peter_dyballa@web.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=skpeterson@nospam.please.ucdavis.edu \
    /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).