emacs ~/.bashrc :

# Test for an interactive shell.  There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
	# Shell is non-interactive.  Be done now!
	return
fi

export SVN_EDITOR="emacs -nw -q"
export CVS_EDITOR="emacs -nw -q"

man() {
env LESS_TERMCAP_mb=$'\E[01;31m' \
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
LESS_TERMCAP_me=$'\E[0m' \
LESS_TERMCAP_se=$'\E[0m' \
LESS_TERMCAP_so=$'\E[38;5;246m' \
LESS_TERMCAP_ue=$'\E[0m' \
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
man "$@"
}

# Manage history between terminals in case of crash
shopt -s histappend
if [ "x$PROMPT_COMMAND" == "x" ]; then
    PROMPT_COMMAND="history -a"
else
    PROMPT_COMMAND="${PROMPT_COMMAND};history -a"
fi

############################################################### bash completion
# from https://github.com/szermatt/emacs-bash-completion
#   To turn off bash completion when running _from emacs_ but keep it on for
#   processes started by bash-completion.el, add this to your .bashrc

if [[ -z "$INSIDE_EMACS" || "$EMACS_BASH_COMPLETE" = "t" ]]; then
    if [ -e /etc/gentoo-release ]; then
	[[ -f /etc/profile.d/bash-completion.sh ]] && source /etc/profile.d/bash-completion.sh
    elif [ -e /etc/debian_version ]; then
	if [ -f /etc/bash_completion ]; then
	    . /etc/bash_completion
	fi
    else
	echo "Weird: can't decide which distro is running!"
    fi
fi
# auto-completion in python interpreter
export PYTHONSTARTUP=~/.pythonrc

alias l="ls -l"
alias ll="ls -l"

function rmc {
    files=`ls .*~ *~ 2> /dev/null`
    if [ "x${files}" != "x" ] ; then
	echo rm ${files}
	rm ${files}
    fi
}

