Browse Source

Initial commit

Emmanuel Bouthenot 17 years ago
commit
721ae2cb06

+ 303 - 0
.emacs

@@ -0,0 +1,303 @@
+;;
+;; GNU Emacs configuration file (~/.emacs) 
+;; 2000-2006,  kolter <kolter@openics.org>
+;;
+;;  This file is distributed in the hope that it will be useful,
+;;  but WITHOUT ANY WARRANTY
+;;
+
+;;-------------------------------------------------------------------
+;; Compiling .emacs : regenerate the .emacs.elc if .emacs is newer
+(defun dotemacscheck! ()
+  "If .emacs exists and is newer than .emacs.elc, recompile it"
+  (cond
+   ((file-newer-than-file-p "~/.emacs" "~/.emacs.elc")
+    (let ((mode-line-format "*** Recompiling .emacs ***"))
+      (sit-for 1)
+      (byte-compile-file "~/.emacs")
+      (message ".emacs.elc recompiled --- reloading...")
+      )
+    (load "~/.emacs.elc" t t t)
+    )))
+(dotemacscheck!)
+
+;;--------------------------------------------------------------------
+;; Emacs internals stuff
+
+;; trace errors (only for debug/testing)
+;;(setq debug-on-error t)
+
+;; adding lisp modules directory
+(add-to-list 'load-path "~/.emacs-lisp/")
+
+;; y = yes && n = no
+(set 'yes-or-no-p 'y-or-n-p)
+
+;; zsh as default shell
+(setq explicit-shell-file-name "/bin/zsh")
+
+;; disable speaker's beep
+(setq visible-bell t)
+
+;; encodings
+(set-terminal-coding-system 'utf-8-unix)
+(set-keyboard-coding-system 'utf-8-unix)
+(set-language-environment 'UTF-8)
+
+;; set a directory to save backup files
+(setq 
+ backup-by-copying t
+ backup-directory-alist '(("." . "~/.emacs-backups/"))
+ delete-old-versions t
+ kept-new-versions 6
+ kept-old-versions 2
+ version-control t)
+;; add a timestamp tobackup files
+;;(add-hook 'write-file-hooks 'time-stamp)
+
+
+;; autoload apache-mode
+;; apache-mode is available in debian package emacs-goodies-el
+(autoload 'apache-mode "apache-mode" "autoloaded" t)
+
+;; define some modes for some filenames
+(add-to-list 'auto-mode-alist '(".htaccess$"   . apache-mode))
+(add-to-list 'auto-mode-alist '("httpd.conf$"  . apache-mode))
+(add-to-list 'auto-mode-alist '("srm.conf$"    . apache-mode))
+(add-to-list 'auto-mode-alist '("access.conf$" . apache-mode))
+
+(add-to-list 'auto-mode-alist (cons "/etc/ssh/ssh_config" 'shell-script-mode))
+(add-to-list 'auto-mode-alist (cons "/etc/ssh/sshd_config" 'shell-script-mode))
+
+(add-to-list 'auto-mode-alist '(".gnus$" . emacs-lisp-mode))
+
+(add-to-list 'auto-mode-alist '("\\.zsh$" . shell-script-mode))
+(add-to-list 'auto-mode-alist '("\\.zshrc$" . shell-script-mode))
+
+;; specific settings for vt420 terminal
+;;(enable-flow-control-on "vt420")
+
+;;--------------------------------------------------------------------
+;; Display stuff
+;;
+
+;; disabling menu bar
+(menu-bar-mode nil)
+
+;; disabling tool bar
+(tool-bar-mode nil)
+
+;; Remove startup messages
+(setq inhibit-startup-message t)
+(setq inhibit-startup-echo-area-message t)
+
+;; clock settings in modeline
+(setq display-time-24hr-format t)
+(setq display-time-day-and-date t )
+(display-time)
+
+;; line and column number in modeline
+(setq column-number-mode t)
+(setq line-number-mode t)
+
+;; fonts (emacs X11)
+(set-default-font "7x14")
+(set-frame-font "7x14")
+
+;; do not extend buffer content with 'down' key
+(setq next-line-add-newlines nil)
+
+;; parenthesis uses
+(show-paren-mode t)
+(setq blink-matching-paren t)
+(setq blink-matching-paren-on-screen t)
+(setq show-paren-style 'expression)
+(setq blink-matching-paren-dont-ignore-comments t)
+
+;; setting maximum colors
+(font-lock-mode t)
+(global-font-lock-mode t)
+(setq font-lock-maximum-decoration t)
+
+;; make selections more visible (color)
+(setq transient-mark-mode t)
+
+;; make the compilation window size fixed
+(setq compilation-scroll-output t)
+
+;; having a soft scrolling !
+(defun point-of-beginning-of-bottom-line ()
+  (save-excursion
+    (move-to-window-line -1)
+    (point)))
+
+(defun point-of-beginning-of-line ()
+  (save-excursion
+    (beginning-of-line)
+    (point)))
+
+(defun next-one-line () (interactive)
+  (if (= (point-of-beginning-of-bottom-line) (point-of-beginning-of-line))
+      (progn (scroll-up 1)
+             (next-line 1))
+    (next-line 1)))
+
+(defun point-of-beginning-of-top-line ()
+  (save-excursion
+    (move-to-window-line 0)
+    (point)))
+
+(defun previous-one-line () (interactive)
+  (if (= (point-of-beginning-of-top-line) (point-of-beginning-of-line))
+      (progn (scroll-down 1)
+             (previous-line 1))
+    (previous-line 1)))
+
+(global-set-key (kbd "<down>") 'next-one-line)
+(global-set-key (kbd "<up>") 'previous-one-line)
+
+
+;; change tab width
+;(setq default-tab-width 4)
+
+;;--------------------------------------------------------------------
+;; Key bindings stuff
+
+;; easy navigation between buffers using cyclebuffer.el
+;; cyclebuffer.el is available in debian package emacs-goodies-el
+(global-set-key [f1] 'cyclebuffer-backward)
+(global-set-key [f2] 'cyclebuffer-forward)
+
+;; easy navigation between windows
+(global-set-key "\C-n" 'other-window)
+(global-set-key "\C-p" '(lambda () (interactive) (other-window -1)))
+
+;; spliting windows
+(global-set-key [f5] 'split-window-vertically)
+(global-set-key [f6] 'split-window-horizontally)
+(global-set-key [f7] 'delete-window)
+(global-set-key [f8] 'delete-other-windows)
+
+;; indent
+(global-set-key [TAB] 'indent-according-to-mode)
+
+(global-set-key "\M-g" 'goto-line)
+(global-set-key "\C-q" 'kill-this-buffer)
+(global-set-key "\M-c" 'compile)
+(global-set-key [f9] 'compile)
+
+;; mouse settings (emacs X11)
+;;(global-set-key (quote [(mouse-5)]) (quote scroll-up))
+;;(global-set-key (quote [(mouse-4)]) (quote scroll-down))
+
+;;-------------------------------------------------------------------
+;; Mutt(ng) stuff
+(load-library "mutt-post")
+;; use muttrc-mode with mutt related files
+;; muttrc-mode is available in debian package emacs-goodies-el
+(add-to-list 'auto-mode-alist '("\\.mutt\\(.*\\)$" . muttrc-mode))
+(add-to-list 'auto-mode-alist '("\\.mutt/conf/\\(.*\\)$" . muttrc-mode))
+(add-to-list 'auto-mode-alist '("\\.muttng/conf/\\(.*\\)$" . muttrc-mode))
+;; automtically wrap lines when composing mail
+(add-to-list 'auto-mode-alist '(".mutt/tmp/mutt-" . post-mode))
+(add-to-list 'auto-mode-alist '(".muttng/tmp/muttng-" . post-mode))
+
+;;-------------------------------------------------------------------
+;; CMake stuff
+(add-to-list 'auto-mode-alist '("\\.cmake$" . cmake-mode))
+(add-to-list 'auto-mode-alist '("\\CMakeLists.txt$" . cmake-mode))
+
+;;-------------------------------------------------------------------
+;; Ispell / Aspell settings
+;; set default ispell dictionnary to french one
+(setq ispell-program-name "/usr/bin/aspell")
+(setq ispell-dictionary "francais")
+
+;; enable flyspell on text-mode
+;;(add-hook 'text-mode-hook
+;;          '(lambda()
+;;             (flyspell-mode)
+;;             ))
+
+;; enable flyspell on post-mode
+;;(add-hook 'post-mode-hook
+;;          '(lambda()
+;;             (flyspell-mode)
+;;             ))
+
+;;-------------------------------------------------------------------
+;; WeeChat coding style
+(setq c-mode-hook
+      '(lambda ()
+	 (c-set-style "K&R")
+	 (setq c-basic-offset 4)
+	 (setq c-tab-always-indent t)))
+
+
+;;-------------------------------------------------------------------
+;; WEB coding
+(load-library "multi-mode")
+(defun web-mode () (interactive)
+  (multi-mode 1
+	      'html-mode
+	      '("<%" ruby-mode)
+	      '("<?php" php-mode)
+	      '("<?" php-mode)
+	      '("<script" java-mode)
+	      '("<style" css-mode)
+	      '("</script" html-mode)
+	      '("?>" html-mode)
+	      '("%>" html-mode)))
+
+(add-hook 'php-mode-hook
+          (lambda()
+	    (defalias 'c-electric-backspace 'delete-backward-char)
+	    (defun c-indent-command () (interactive "*") (self-insert-command 1))
+	    (define-key php-mode-map "\C-a" 'beginning-of-line-text)
+	    (define-key php-mode-map [home] 'beginning-of-line-text)
+	    )
+	  )
+(add-hook 'html-mode-hook
+          (lambda()
+	    (defun indent-for-tab-command () (interactive "*") (self-insert-command 1))
+	    (define-key html-mode-map "\C-a" 'beginning-of-line-text)
+	    (define-key html-mode-map [home] 'beginning-of-line-text)
+	    (define-key html-mode-map (kbd "RET") 'newline-and-indent)
+	    )
+	  )
+(add-to-list 'auto-mode-alist '("\\.php$" . web-mode))
+(add-to-list 'auto-mode-alist '("\\.rhtml$" . web-mode))
+
+
+(defun indent-region-with-tab ()
+  (interactive)
+  (save-excursion
+    (if (< (point) (mark)) (exchange-point-and-mark))
+    (let ((save-mark (mark)))
+      (if (= (point) (line-beginning-position)) (previous-line 1))
+      (goto-char (line-beginning-position))
+      (while (>= (point) save-mark)
+	(goto-char (line-beginning-position))
+	(insert "\t")
+	(previous-line 1)))
+    (setq deactivate-mark nil)
+    ))
+
+
+(defun unindent-region-with-tab ()
+  (interactive)
+  (save-excursion
+    (if (< (point) (mark)) (exchange-point-and-mark))
+    (let ((save-mark (mark)))
+      (if (= (point) (line-beginning-position)) (previous-line 1))
+      (goto-char (line-beginning-position))
+      (while (>= (point) save-mark)
+	(goto-char (line-beginning-position))
+	(if (= (string-to-char "\t") (char-after (point))) (delete-char 1))
+	(previous-line 1)))
+    (setq deactivate-mark nil)
+    ))
+
+(global-set-key "\C-xi" 'indent-region-with-tab)
+(global-set-key "\C-xj" 'unindent-region-with-tab)
+

+ 302 - 0
.emacs-lisp/multi-mode.el

@@ -0,0 +1,302 @@
+;;; multi-mode.el --- Allowing multiple major modes in a buffer.
+;;;****************************************************************************
+;;; $Id: multi-mode.el,v 1.2 2002/11/15 09:33:50 marmotte Exp $
+;;;****************************************************************************
+;;
+;;
+;; Description:
+;;
+;;	Sometimes it is  desirable to  have different  major modes  in  one
+;;	buffer.  One   such   case occurs   when   editing  comments  in  a
+;;	programming language buffer.  Here it  might be desirable to use  a
+;;	totally  different mode than the  one used  for editing the program
+;;	code itself.
+;;
+;;	I have adoped this practice for editing Prolog.  The code itself is
+;;	edited   in prolog-mode,   whereas  the   comments  are edited   in
+;;	LaTeX-mode.
+;;
+;;	It  is  desirable to use different   modes instead of enhancing one
+;;	mode  because much  efford has  already  been put in various  modes
+;;	which needs not to be duplicated.
+;;
+;;	The multi-mode minor  mode provides  a means  to accomplish  such a
+;;	feature.
+;;
+;;	The modes  are described  by  initializing strings.   I assume that
+;;	certain tokens (i.e. transition strings)  indicate the places where
+;;	a new mode should be entered. To  determine the mode  at a point it
+;;	is only neccessary to find the last transition string before point.
+;;
+;;	The desired   modes are described  in  a list of   pairs or triples
+;;	consisting  of   a  transition   string  and a   mode   (a symbol).
+;;	Optionally a function symbol can be specified which is evaluated to
+;;	activate  the desired mode.  Additionally   the mode in absence  of
+;;	preceding transition strings has to be specified.
+;;
+;;
+;;
+;;
+;; Installation:
+;;	1. Ensure that multi-mode.el is on the load-path.
+;;	2. For efficiency it might be desirable to byte-compile 
+;;	   multi-mode.el.
+;;	3. Put the following in your .emacs file or a similar place
+;;	   where it is loaded when needed.
+;;
+;;	   (autoload 'multi-mode
+;;		     "multi-mode"
+;;		     "Allowing multiple major modes in a buffer."
+;;		     t)
+;;
+;;	4. Define  your own  incarnation of multi  mode  to serve as major
+;;	   mode.  This can be done in your .emacs file.  E.g.
+;;
+;;	   (defun multi-c-fundamental-mode () (interactive)
+;;	     (multi-mode 1
+;;			 'c-mode
+;;			 '(\"/*\" fundamental-mode my-fundamental-setup)
+;;			 '(\"*/\" c-mode)))
+;;
+;;	   This major mode can now be used to turn on the multi-mode in the
+;;	   minibuffer, or in the auto-mode-alist, or in the local variables
+;;	   of a file. E.g.
+;;
+;;	   (setq auto-mode-alist
+;;		 (cons '("\\.[ch]$" . multi-c-fundamental-mode)
+;;		 auto-mode-alist)
+;;
+;;
+;; Bugs and Problems:
+;;	- It is rather easy to hang my whole workstation when
+;;	  multi-mode-transitions has not a proper value.
+;;	  For sake of efficiency I omit finer type checking to avoid this
+;;	  problem.
+;;	  CURE: Never try to change the variable yourself. Use the
+;;		function multi-mode instead.
+;;
+;; To do:
+;;	- The generalization of transition strings to regular expressions
+;;	  seems to be straight forward. For efficience reasons I will do it
+;;	  only upon request.
+;;
+;;	- No provisions have been made to make the key bindings accessible
+;;	  in all modes. This might be desirable.
+;;
+;;
+;; Changes:
+;; $Log: multi-mode.el,v $
+;; Revision 1.2  2002/11/15 09:33:50  marmotte
+;;
+;; * Make most of the config compile
+;;
+;; Revision 1.1  2002/11/14 08:36:38  marmotte
+;; * Changed load of file, to load-path, so that the config files are not
+;; 	always loaded.
+;; * Added multi-mode to the emacs config
+;; * Added support for php and jsp, throught multi-mode.
+;; - Still need to add a version of c++-mode for php, cause somethings are
+;; 	not really well handled...
+;;
+; Revision 1.2  1994/06/11  22:08:22  gerd
+; *** empty log message ***
+;
+; Revision 1.1  1994/05/24  12:41:30  gerd
+; A little hack has been enhanced to a minor mode.
+;;
+;;
+;; Author:	
+;;	Gerd Neugebauer
+;;	Vdenburger Str. 16
+;;	64295 Darmstadt (Germany)
+;;
+;;	Net: gerd@intellektik.informatik.th-darmstadt.de
+;;	     gerd@imn.th-leipzig.de
+;;
+;;*****************************************************************************
+;; LCD Archive Entry:
+;; multi-mode|Gerd Neugebauer|gerd@intellektik.informatik.th-darmstadt.de|
+;; Minor mode allowing multiple major modes in a single buffer.|
+;; 11-Jun-1994|1.2|~/misc/multi-mode.el.Z|
+;;*****************************************************************************
+;;
+;; Copyright (C) 1994 Gerd Neugebauer
+;;
+;; multi-mode.el is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY.  No author or distributor
+;; accepts responsibility to anyone for the consequences of using it
+;; or for whether it serves any particular purpose or works at all,
+;; unless he says so in writing.  Refer to the GNU General Public
+;; License for full details.
+;;
+;; Everyone is granted permission to copy, modify and redistribute
+;; multi-mode.el, but only under the conditions described in the
+;; GNU General Public License.	 A copy of this license is
+;; supposed to have been given to you along with GNU Emacs so you
+;; can know your rights and responsibilities.  It should be in a
+;; file named COPYING.	Among other things, the copyright notice
+;; and this notice must be preserved on all copies.
+;;
+
+;;;----------------------------------------------------------------------------
+;;; Variable definitions and initializations
+
+
+
+(make-variable-buffer-local 'multi-mode-transitions)
+(defvar multi-mode-transitions nil
+  "Transition definition for the multi-mode minor mode.
+")
+
+(defvar multi-mode-beware '( (not isearch-mode) )
+  "List of forms to check if multi-mode is desirable. If all forms evaluate to
+t then a mode switch is allowed.")
+
+(make-variable-buffer-local 'multi-mode)
+(defvar multi-mode nil
+  "This variable indicates if the multi-mode minor mode is active.")
+
+
+;;;----------------------------------------------------------------------------
+;;; Definition of the minor mode
+
+(defun multi-mode (&optional arg &optional initial-mode &rest transitions) 
+  "Allowing multiple major modes in a buffer.
+
+Toggle multi mode. With numeric argument turn on multi mode if the argument
+is positive.
+
+Sometimes it is desirable to have different major modes in one buffer.  One
+such case occurs  when editing comments  in a programming  language buffer.
+Here it  might be desirable  to use a totally  different mode  than the one
+used for editing the program code itself.
+
+It is desirable   to use different  modes  instead  of enhancing one   mode
+because much effort has  already been put  in various modes which needs not
+to be duplicated.
+
+The multi-mode minor mode provides a means to accomplish such a feature.
+
+The  modes are described  by initializing  strings.  I assume that  certain
+tokens (i.e.  transition  strings)  indicate  the places  where a  new mode
+should be entered.  To determine  the mode at a point  it is only necessary
+to find the last transition string before point.
+
+The desired modes are described in a list of pairs or triples consisting of
+a transition string and  a mode (a  symbol).  Optionally a function  symbol
+can   be specified   which  is evaluated  to   activate  the desired  mode.
+Additionally the mode in absence of preceding transition  strings has to be
+specified.
+
+When called not interactively there are additional arguments to specify the
+transitions.
+
+INITIAL-MODE  is a symbol denoting   a major mode   to  be used before  any
+transition strings are present before point.
+
+The remaining optional arguments are pairs
+	(TOKEN MODE)
+or triples
+	(TOKEN MODE FUNCTION)
+
+The first element TOKEN is  a string which indicates  the token to activate
+the mode MODE specified in the second argument. Optionally a third argument
+can  be given. The  symbol FUNCTION is  used as a function  to be called to
+turn on the mode given as second argument. It defaults to MODE.
+
+Consider the following example:
+
+(multi-mode 1
+	    c-mode
+	    (\"/*\" fundamental-mode my-fundamental-setup)
+	    (\"*/\" c-mode))
+
+The first argument forces multi-mode to be  turned on.  The second argument
+declares the default mode to be c-mode. Thus at the beginning of the buffer
+c-mode is turned on. If a '/*'  is found before point then fundamental-mode
+may be turned on. This is done using the function my-fundamental-setup.
+
+If a '*/' is found before point then c-mode may be activated. Which mode is
+used depends on the last activating  pattern before point.  In this example
+everything between /* and */ can be edited  in fundamental mode. Everything
+else is in c-mode.
+
+See also the documentation of multi-mode-beware.";"
+(interactive "P")
+(setq multi-mode				; 
+      (if (null arg) (not multi-mode)		; Toggle multi-mode if no arg
+	(> (prefix-numeric-value arg) 0)))	; otherwise turn it on or off
+(let ((ok   t)				; result of type check
+      (tt   transitions)			; transition table
+	trans)					; transition
+  (while tt					; Check the transition table
+    (setq trans (car tt)			; Get a single transition
+            tt    (cdr tt))			; Advance the table pointer
+    (if (or (not (listp   trans))		; Check the transition
+	      (not (stringp (first trans)))	;
+	      (not (symbolp (second trans))))	;
+	(setq ok nil				; set error mark
+	      tt nil))			; stop checking
+    )
+    (if (and ok					; if transition table is ok
+	     initial-mode			; check the initial-mode
+	     (symbolp initial-mode))		;
+	(setq multi-mode-transitions		; set the local variable
+	      (cons initial-mode transitions)))	;
+    )
+
+  (force-mode-line-update)			; show the new state
+)
+
+(or (assq 'multi-mode minor-mode-alist)
+    (setq minor-mode-alist (cons '(multi-mode " MULTI") minor-mode-alist)))
+
+
+(defun multi-mode-update-mode ()
+  "Perform a mode switch if multi-mode is active."
+  ;; This function only starts to work if multi mode is on
+  ;; and a transition table is defined. Additionally the forms in
+  ;; multi-mode-beware are evaluated to see if a mode switch is desirable.
+  (if (and multi-mode
+	   multi-mode-transitions
+	   (eval (cons 'and multi-mode-beware))
+	   )
+      (let* ((transition    (cdr multi-mode-transitions)) ; get transitions
+	     (mode          (car multi-mode-transitions)) ; get initial mode
+	     (mode-function mode)       ; set initial mode switching function
+	     (pos           -1)		; set the initial position of a transit
+	     hit			; new position of a transition string
+	     tt)			; transition table
+	(while transition
+	  (setq tt         (car transition)	; extract a single transition
+		transition (cdr transition))	; advance the transitions
+	  (setq hit (save-excursion		; we don't want to change point
+		      (if (search-backward	; unfailing backward search
+			   (first tt)		;  for the transition pattern
+			   nil
+			   t)
+			  (point)		; upon sucess use the position
+			-2)))			; otherwise try to ignore it
+	  (if (> hit pos)			; pattern is newer than prev.
+	      (setq pos		  hit		;  then save position
+		    mode	  (second tt)	;  the desired mode and an
+		    mode-function (or (third tt) mode)); optional function
+	  )
+	)
+	(if (not (equal major-mode mode))	; if mode needs switching
+	    (let ((transitions multi-mode-transitions)) ; save transition table
+	      (if (fboundp mode-function)	; if mode function is defined
+		  (funcall mode-function))	;  then call it
+	      (setq multi-mode-transitions transitions  ; restore transition
+		    multi-mode t)))		; and minor mode
+      )
+  )
+)
+
+;;;----------------------------------------------------------------------------
+;;; The function is hooked into the post-command-hook to be called after
+;;; each function.
+;;;
+(add-hook 'post-command-hook 'multi-mode-update-mode)
+
+(provide 'multi-mode)

+ 1397 - 0
.emacs-lisp/mutt-post.el

@@ -0,0 +1,1397 @@
+;	$Id: post.el,v 2.4 2004/07/23 23:13:17 rreid Exp rreid $
+;; post.el --- Use (X?)Emacs(client) as an external editor for mail and news.
+ 
+;;; Authors: Eric Kidd <eric.kidd@pobox.com>,
+;;;          Dave Pearson <davep@davep.org>,
+;;;          Rob Reid <reid@astro.utoronto.ca>,
+;;;          Roland Rosenfeld <roland@spinnaker.de>
+
+;; This is free software distributed under the GPL, yadda, yadda, yadda.
+;; It has no warranty. See the GNU General Public License for more
+;; information. Send us your feature requests and patches, and we'll try
+;; to integrate everything.
+
+;;; Maintainer: Rob Reid <reid@astro.utoronto.ca>
+
+;;; Keywords: mail
+
+;;; Commentary:
+;; This is a major mode for use with Mutt, the spiffy *nix mailreader du jour
+;; (See http://www.mutt.org/), slrn, the spiffy *nix newsreader du jour, or
+;; whatever you can get it to work with.  To use this mode, add the following
+;; line to the .emacs file in your home directory:
+;;
+;;   (load "/your/local/path/to/this/file/post")
+;;
+;; Note that you can omit the ".el" from the file name when calling load.
+;;
+;; If you want to make it available to all your users, type \C-h v
+;; load-path RET, pick an appropriate directory for post.el, and modify
+;; your sitewide default.el to (require 'post).
+;;
+;; You may find the latest version of this mode at
+;; http://astro.utoronto.ca/~reid/mutt/
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; BUGS:
+;;
+;; Rob: I predict that some buffers (*Original*<2>, *Composing*<2>?)
+;; will be left behind if you edit more than one message at a time.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Thanks
+;;;
+;;; Dave Pearson: Code, feature ideas, Mutt experience. Many thanks!
+;;; Louis Theran: Encouragement to make Mutt mode work like Emacs MUAs.
+;;; Ronald: Enlightening gripes about what Emacs should do, but doesn't.
+;;; Robert Napier: Bug reports about font-lock mode, fancy wrapping.
+;;; Kevin Rodgers: Answered RR's question on gnu.emacs.help on
+;;; overwriting server-process-filter's annoying message at startup.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Revision History
+;;;
+;;; $Log: post.el,v $
+;;; Revision 2.401  2004/07/23 16:27:29  rreid
+;;; Fixed post-delete-quoted-signatures to not remove sneaky things like quoted
+;;; double dash arrows.  Thanks go to Felix Klee for a clear bug report.
+;;;
+;;; Revision 2.4  2002/04/22 22:04:29  reid
+;;; Tweaked post-emoticon-pattern yet again.  Made cl mandatory for all
+;;; versions of emacs.  (Thanks to Eric Dorland and Mike Schiraldi for bug
+;;; reports.)  Fixed post-unquote-region.  (Thanks to Mike Schiraldi for the
+;;; bug report.)
+;;;
+;;; Revision 2.3  2002/04/21 20:13:55  reid
+;;; Improved post-emoticon-pattern.
+;;;
+;;; Revision 2.2  2002/04/20 04:12:54  reid
+;;; Improved post-emoticon-pattern.
+;;;
+;;; Revision 2.1  2002/04/20 03:17:48  reid
+;;; - A major (but not total) synchronization with Dave Pearson's post-mode.
+;;;   header-set-followup-to and header-set-organization should work now.
+;;; - Syntax highlighting now works for quoted email addresses and URLs.
+;;; - *bold* words are now highlighted.
+;;; - Emoticons can now be highlighted, and the default regexp,
+;;;   post-emoticon-pattern, might be too enthusiastic for your taste.  In case
+;;;   you're curious, I verified that gnus' smiley-ems.el works with post, but I
+;;;   decided that it wasn't ideal.
+;;; - post-url-text-pattern changed to post-url-pattern and made more enthusiastic.
+;;;
+;;; revision 1.95 2002/04/10 00:06:26 reid
+;;; Fixed the regexp in post-kill-signature to not delete everything between
+;;; mutt's standard forwarding lines.  post-kill-signature is called indirectly
+;;; by many functions.
+;;;
+;;; Revision 1.9  2002/04/04 22:24:31  reid
+;;; Applied a patch (not quite verbatim) from The Anarcat
+;;; <anarcat@anarcat.dyndns.org> to make the entity separating siglets in
+;;; `post-variable-signature-source' a regexp, `post-signature-sep-regexp'.  The
+;;; default works either either the old post file format or strfiled (fortune)
+;;; files.
+;;;;
+;;; Changed default `post-random-signature-command' to `fortune
+;;; ~/.mutt/sigs.fortune'.
+;;;
+;;; `post-random-signature-command' should now NOT supply a fixed sig portion!
+;;;
+;;; (post-el-random-signature) supplied by The Anarcat to do random sig
+;;; selection purely within Emacs Lisp.
+;;;
+;;; Revision 1.8  2002/02/06 22:24:31  eric
+;;; clean up
+;;;
+;;; Revision 1.7.2  2002/02/06 22:17:01  eric
+;;; tweak regexps, make font-lock-comment-face be post-signature-text-face
+;;;
+;;; Revision 1.7.1  2002/02/06 21:58:58  eric
+;;; tweak regexp, change some types to regexp
+;;;
+;;; Revision 1.7.0  2002/02/06 21:36:56  eric
+;;; hilight signatures, urls and emails
+;;;
+;;; Revision 1.6.3.10  1999/10/11 00:29:41  roland
+;;; Corrected color quoting again: Now allows ">" in the middle of
+;;; a line which is quoted twice.
+;;;
+;;; Revision 1.6.3.9  1999/10/08 10:43:18  roland
+;;; Add third level of quoting faces.
+;;; Allow super-cite name prefixes before quote signs.
+;;;
+;;; Revision 1.6.3.8  1999/10/08 08:39:00  roland
+;;; post-font-lock-keywords now detects lines with only "> "in it
+;;; correctly (merged following line into it before).
+;;;
+;;; Revision 1.6.3.7  1999/10/04 10:07:48  roland
+;;; Add post-quote-region and post-unquote-region commands to quote and
+;;; unquote a region (one level).
+;;;
+;;; Revision 1.6.3.6  1999/09/03 23:13:55  reid
+;;; Valeriy E. Ushakov <uwe@ptc.spbu.ru> pointed out that (GNU) Emacs <20 has
+;;; fewer (optional) arguments to (read-string) than what I was using to
+;;; inherit the input method.  I didn't find a way off the top of my head
+;;; to redefine (read-string) without causing an infinite loop, so I have
+;;; substituted a macro (string-read prompt) which does the right thing,
+;;; so please use it instead of read-string.
+;;;
+;;; Revision 1.6.3.5  1999/08/29 19:58:49  reid
+;;; Changed default post-mail-message to handle hostnames with digits.
+;;; Thanks to Brian D. Winters <brianw@alumni.caltech.edu>.
+;;;
+;;; Revision 1.6.3.4  1999/03/20 03:02:05  reid
+;;; Made post compatible with emacs as far back as 19.28.1, probably
+;;; farther.
+;;;
+;;; Revision 1.6.3.3  1999/03/16 03:14:07  reid
+;;; Cleaned up post-select-signature-select-sig-from-file code.
+;;;
+;;; Revision 1.6.3.2  1999/03/16 03:05:12  reid
+;;; Fixed alist updating.
+;;;
+;;; Revision 1.6.3.1  1999/03/13 02:23:48  reid
+;;; Added defface to the list of things that get defined if customize
+;;; hasn't already done it.  Thanks to Melissa Binde for the bug report.
+;;;
+;;; Modified post-body-says-attach to use a regexp,
+;;; post-attachment-regexp, so that something like "\(attach\|anbringen\)"
+;;; can be used by bilingual people like Roland.
+;;;
+;;; Revision 1.6.2.1  1999/03/12 10:16:11  roland
+;;; Added missing () to post-insert-to-auto-mode-alist-on-load.
+;;;
+;;; Revision 1.6.2 1999/03/11 15:51 Dave Pearson
+;;; header-position-on-value fixed to return (point), and
+;;; defcustom macro provided for Emacs 19 users.
+;;;
+;;; Revision 1.6.1.2  1999/03/06 11:24:43  roland
+;;; Added post-insert-to-auto-mode-alist-on-load.
+;;;
+;;; Revision 1.6.1.1  1999/03/06 11:02:27  roland
+;;; Customized renaming of buffer.
+;;; Removed different handling for mail, news, news-reply.
+;;; Fixed problems with easy-menu under XEmacs.
+;;;
+;;; Revision 1.6.0 1999/03/04 18:04 Rob Reid
+;;; Returned post-signature-pattern to using "--" instead of "-- "
+;;; because some senders have broken MTAs (as Eric reminded me) and
+;;; some users don't use procmail to compensate.  This time all of the
+;;; functions dealing with signatures have been smartened up to avoid
+;;; false matches.  Unfortunately that means they don't use
+;;; post-signature-pattern in its raw form.
+;;;
+;;; Added post-backup-original so that Dave's post-copy-original can
+;;; be used.
+;;;
+;;; Kevin Rodgers explained how to put this in .emacs to fix the
+;;; server-process-filter's annoying message problem:
+;;;
+;;; Revision 1.1  1999/03/04 18:02:30  reid
+;;; Initial revision
+;;;
+;;; %%%%%%%%%%%% Put in .emacs %%%%%%%%%%%
+;;;
+;;; ;;; Email
+;;; (server-start)
+;;; (load "/home/reid/.mutt/post")
+;;; (defadvice server-process-filter (after post-mode-message first activate)
+;;;    "If the buffer is in post mode, overwrite the server-edit
+;;;    message with a post-save-current-buffer-and-exit message."
+;;;    (if (eq major-mode 'post-mode)
+;;;        (message
+;;;         (substitute-command-keys "Type \\[describe-mode] for help composing; \\[post-save-current-buffer-and-exit] when done."))))
+;;; ; This is also needed to see the magic message.  Set to a higher
+;;; ; number if you have a faster computer or read slower than me.
+;;; '(font-lock-verbose 1000)
+;;; ; (setq server-temp-file-regexp "mutt-")
+;;; (add-hook 'server-switch-hook
+;;;         (function (lambda()
+;;;                     (cond ((string-match "Post" mode-name)
+;;;                            (post-goto-body))))))
+;;;
+;;; %%%%%%%%% We now return to our regular commentary %%%%%%%%%
+;;;
+;;; Eric Kidd asked that the name of Headers mode be changed so that
+;;; it doesn't conflict with mutt-mode's Headers, so I changed it to
+;;; just Header (no s).
+;;;
+;;; Revision 1.5? 1999/02/27 17:30 Rob Reid
+;;; I had a go at combining Dave Pearson's post mode with Eric Kidd's
+;;; Mutt mode.  Since Dave Pearson's post mode explicitly handles news as
+;;; well as email, and this should be useful for more than just mutt,
+;;; I'm calling it post mode.  I also added functions for picking
+;;; random signatures, selecting a signature from a file, and
+;;; intelligently (IMHO) prompting the user for an attachment when
+;;; necessary.  Changed mutt-save-buffer-and-exit to work better with
+;;; emacsclient, and some of the key bindings.  post-signature-pattern
+;;; now defaults to use "-- " instead of "--", and I have far less
+;;; trouble this way (I use procmail to clean up braindead "--"s.).  I
+;;; don't know why Eric warned against trailing whitespace.
+;;;
+;;; Revision 1.4  1998/04/11 00:05:46  emk
+;;; Fixed font-lock bug. Also made mutt-mode a little more careful about
+;;; saving various bits of Emacs state when moving around the buffer.
+;;;
+;;; Revision 1.3  1998/03/25 00:37:36  emk
+;;; Added support for menus and font-lock mode, plus a few bug fixes.
+;;;
+;;; Revision 1.2  1998/03/24 13:19:46  emk
+;;; Major overhaul--more commands, a minor mode for header editing, and other
+;;; desirable features. Attaching files seems to be broken, though.
+;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Required Packages
+
+(require 'cl)
+(require 'derived)
+(require 'easymenu)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Customization Support
+;;;
+;;; Set up our customizable features. You can edit these (and lots of other
+;;; fun stuff) by typing M-x customize RET. The Post preferences can be
+;;; found under the [Applications] [Mail] category.
+
+;; Make post mode a bit more compatible with older (i.e. <20) versions of emacs.
+;;; Code:
+(eval-and-compile
+  ;; Dumb down read-string if necessary.
+  ;; The number of optional arguments for read-string seems to increase
+  ;; sharply with (emacs-version).  Since old versions of emacs are a large
+  ;; source of bug reports it might be worth writing (or looking for)
+  ;; (bug-report reid@astro.utoronto.ca) which emails me the result of
+  ;; (emacs-version) along with a user supplied description of the problem.
+  ;; GNU Emacs 19.28.1 only has INITIAL-STRING as an optional argument.
+  ;; 19.34.1 has (read-string PROMPT &optional INITIAL-INPUT HISTORY).  20.2.1
+  ;; has (read-string PROMPT &optional INITIAL-INPUT HISTORY DEFAULT-VALUE
+  ;; INHERIT-INPUT-METHOD).
+  ;; Since I haven't found a way of redefining read-string without causing an
+  ;; infinite loop, please use (string-read prompt).
+  (if (< (string-to-number (substring (emacs-version)
+				      (string-match "[0-9]+\.[0-9]"
+					 (emacs-version) 5))) 20)
+      (defmacro string-read (prompt) (` (read-string (, prompt))))
+      (defmacro string-read (prompt)
+	(` (read-string (, prompt) nil nil nil t))))
+
+  ;; XEmacs gnuserv uses slightly different functions than the GNU Emacs
+  ;; server, and some people are still wasting time and CPU cycles by starting
+  ;; up a new emacs each time.
+  (cond ((fboundp 'server-edit)
+	 (fset 'post-finish 'server-edit))
+	((fboundp 'gnuserv-kill-buffer-function)
+	 (fset 'post-finish 'gnuserv-kill-buffer-function))
+	(t
+	 (fset 'post-finish 'save-buffers-kill-emacs)))
+   
+  ;; If customize isn't available just use defvar instead.
+  (unless (fboundp 'defgroup)
+    (defmacro defgroup  (&rest rest) nil)
+    (defmacro defcustom (symbol init docstring &rest rest)
+      ; The "extra" braces and whitespace are for emacs < 19.29.
+      (` (defvar (, symbol) (, init) (, docstring))))
+    (defmacro defface (&rest args) nil))
+  (unless (fboundp 'buffer-substring-no-properties)
+    (fset 'buffer-substring-no-properties 'buffer-substring)))
+
+(defgroup post nil
+  "Composing e-mail messages with Post.
+Emacs can run as an external editor for Mutt, the spiffy Unix mail reader
+du jour, or slrn, the spiffy Unix news reader du jour.  You can get
+Mutt from http://www.mutt.org/."
+  :group 'mail)
+
+(defcustom post-uses-fill-mode t
+  "*Specifies whether Post should automatically wrap lines.
+Set this to t to enable line wrapping, and nil to disable line
+wrapping.  Note that if a paragraph gets messed up (the line wrapper
+is very primitive), you can type \\[fill-paragraph] to rewrap the paragraph."
+  :type 'boolean
+  :group 'post)
+
+(defcustom post-mail-message "mutt-[a-z0-9]+-[0-9]+-[0-9]+\\'"
+  "*Regular expression which matches your mailer's temporary files."
+  :type 'string
+  :group 'post)
+
+(defcustom post-news-posting "\\.\\(followup\\|letter\\|article\\)$"
+  "*Regular expression which matches your news reader's composition files."
+  :type 'string
+  :group 'post)
+
+(defcustom post-backup-original nil
+  "*Controls whether a pristine backup of the original is kept for reference."
+  :type 'boolean
+  :group 'post)
+
+(defcustom post-signature-pattern "\\(--\\|Cheers,\\|\\)"
+  "*Pattern signifying the beginning of signatures.
+It should not contain trailing whitespace unless you know what you're doing."
+  :type 'regexp
+  :group 'post)
+
+(defcustom post-signature-sep-regexp "^\\(%\\|^L\\|--\\)?\n"
+  "*Regular expression delimiting signatures in the signature file.
+This allows the use of classic fortune files as signature files.
+This should normally contain a newline."
+  :type 'regexp
+  :group 'post)
+
+(defcustom post-signature-source-is-file t
+  "*Toggles the signature source type between file and directory."
+  :type 'boolean
+  :group 'post)
+
+(defcustom post-variable-signature-source "~/.mutt/sigs.fortune"
+  "*Location of the variable part of your signature.
+Post uses this to locate signatures.  It can be either a directory
+with one item per file or a file with items separated by blank lines."
+  :type 'string
+  :group 'post)
+
+(defcustom post-fixed-signature-source "~/.fixedsig"
+  "*File with the fixed part of your signature."
+  :type 'string
+  :group 'post)
+
+(defcustom post-signature-directory "~/.sigs/"
+  "*The directory that contains your collection of signature files."
+  :type 'string
+  :group 'post)
+
+(defcustom post-signature-wildcard "sig*"
+  "*Wildcard for finding signature files in your signature directory."
+  :type 'string
+  :group 'post)
+
+(defcustom post-random-signature-command "fortune ~/.mutt/sigs.fortune"
+  "*Command to run to get a random signature.
+Examples are available at http://astro.utoronto.ca/~reid/mutt/"
+  :type 'string
+  :group 'post)
+
+(defcustom post-kill-quoted-sig t
+  "Specifies whether `post-mode' should automatically kill quoted signatures."
+  :type 'boolean
+  :group 'post)
+
+(defcustom post-jump-header t
+  "Specifies wheather `post-mode' should jump to the body."
+  :type 'boolean
+  :group 'post)
+
+(defcustom post-force-pwd-to-home t
+  "Specifies whether `post-mode' should cd to your home directory."
+  :type 'boolean
+  :group 'post)
+
+(defcustom post-email-address (concat (user-login-name) "@" mail-host-address)
+  "*Your email address."
+  :type 'string
+  :group 'post)
+
+(defcustom post-should-prompt-for-attachment 'Smart
+  "*Controls whether an attachment will be prompted for before saving
+the message and exiting.  'Smart' will prompt only if the body
+contains post-attachment-regexp."
+  :type '(choice (const Never)
+		 (const Smart)
+		 (const Always))
+  :group 'post)
+
+(defcustom post-attachment-regexp "attach"
+  "*This is what post looks for in the body if
+post-should-prompt-for-attachment is 'Smart'."
+  :type 'regexp
+  :group 'post)
+
+(defcustom post-news-poster-regexp "^On .*<.*>.*wrote:$"
+  "Regular expression used to locate the attribution line of a news posting."
+  :type 'regexp
+  :group 'post)
+
+(defcustom post-rename-buffer t
+  "Specify whether `post-mode' should rename the buffer to *Composing*."
+  :type 'boolean
+  :group 'post)
+
+(defcustom post-insert-to-auto-mode-alist-on-load t
+  "Automatically insert `post-mode' with `post-mail-message' to `auto-mode-alist'."
+  :type 'boolean
+  :group 'post)
+
+(defcustom post-mode-hook nil
+  "List of hooks to be executed on entry to `post-mode'."
+  :group 'post)
+
+(defcustom post-quote-start "> "
+  "Pattern which is added (or removed) at the beginning of the line by
+comment-region"
+  :group 'post)
+
+(defcustom post-email-address-pattern
+  "[A-Za-z0-9_][-A-Za-z0-9._]*@[-A-Za-z0-9._]*[A-Za-z0-9]"
+  "Pattern to detect email addresses."
+  :type 'regexp
+  :group 'post)
+
+(defcustom post-url-pattern
+  '("\\<\\(\\(https?\\|news\\|mailto\\|ftp\\|gopher\\):\\|\\(www\\|ftp\\)\\.\\)[-~A-Za-z0-9._/%$+?#]+[A-Za-z0-9/#]" "<URL:[^ ]+>")
+  "Pattern to detect URL addresses."
+  :type '(repeat regexp)
+  :group 'post)
+
+(defcustom post-bold-pattern '("\\*\\w+\\*")
+  "*List of regular expressions that define bold text."
+  :type '(repeat regexp)
+  :group 'post)
+
+(defcustom post-underline-pattern '("_\\w+_")
+  "*List of regular expressions that define underlined text."
+  :type '(repeat regexp)
+  :group 'post)
+
+(defcustom post-emoticon-pattern '("[0O(<{}]?[;:8B|][.,]?[-+^*o0O][{<>/\|]?[][)>(<|/\P][)>]?"
+			"\\s [(<]?[][)>(<|/\][}<>|]?[-+^*oO0][,.]?[:8][0O>]?"
+			"\\s [;:][][P)\/(]" "\\s [][)(P\/][:;]"
+				   "<[Gg]>" "<[BbSs][Gg]>")
+  "*List of regular expressions that define a emoticon."
+  :type '(repeat regexp)
+  :group 'post)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Customizable Faces
+;;; If you find a more attractive color scheme for dark backgrounds, please
+;;; email it to reid@astro.utoronto.
+
+(defgroup post-faces nil
+  "Typefaces used for composing messages with Post."
+  :group 'post
+  :group 'faces)
+
+(defface post-header-keyword-face
+  '((((class color)
+      (background light))
+     (:foreground "Navy" :bold t))
+    (((class color)
+      (background dark))
+     (:foreground "LightBlue" :bold t))
+    (t
+     (:bold t)))
+  "Face used for displaying keywords (e.g. \"From:\") in header."
+  :group 'post-faces)
+
+(defface post-header-value-face
+  '((((class color)
+      (background light))
+     (:foreground "MidnightBlue"))
+    (((class color)
+      (background dark))
+     (:foreground "LightSteelBlue")))
+  "Face used for displaying the values of header."
+  :group 'post-faces)
+
+(defface post-quoted-text-face
+  '((((class color)
+      (background light))
+     (:foreground "Sienna" :italic t))
+    (((class color)
+      (background dark))
+     (:foreground "Wheat" :italic t))
+    (t
+     (:bold t :italic t)))
+  "Face used for displaying text which has been quoted (e.g. \">foo\")."
+  :group 'post-faces)
+
+(defface post-double-quoted-text-face
+  '((((class color)
+      (background light))
+     (:foreground "Firebrick" :italic t))
+    (((class color)
+      (background dark))
+     (:foreground "Tan" :italic t))
+    (t
+     (:italic t)))
+  "Face used for text which has been quoted twice (e.g. \">>foo\")."
+  :group 'post-faces)
+
+(defface post-multiply-quoted-text-face
+  '((((class color)
+      (background light))
+     (:foreground "goldenrod" :italic t))
+    (((class color)
+      (background dark))
+     (:foreground "tan3" :italic t))
+    (t
+     (:italic t)))
+  "Face used for text which has been quoted more than twice (e.g. \">>>foo\")."
+  :group 'post-faces)
+
+(defface post-signature-text-face
+  '((((class color)
+      (background light))
+     (:foreground "red3"))
+    (((class color)
+      (background dark))
+     (:foreground "red1"))
+    (t
+     (:bold t)))
+  "Face used for text that is part of a signature"
+  :group 'post-faces)
+
+(defface post-email-address-text-face
+  '((((class color)
+      (background light))
+     (:foreground "green3"))
+    (((class color)
+      (background dark))
+     (:foreground "green1"))
+    (t
+     (:italic t)))
+  "Face used for email addresses"
+  :group 'post-faces)
+
+(defface post-url-face
+  '((((class color)
+      (background light))
+     (:foreground "green3" :bold t))
+    (((class color)
+      (background dark))
+     (:foreground "green1" :bold t))
+    (t
+     (:italic t)))
+  "Face used for URL addresses"
+  :group 'post-faces)
+
+(defface post-emoticon-face
+  '((((class color)
+      (background light))
+     (:foreground "black" :background "yellow" :bold t))
+    (((class color)
+      (background dark))
+     (:foreground "black" :background "yellow" :bold t))
+    (t
+     (:bold t)))
+  "Face used for text matched by post-emoticon-pattern."
+  :group 'post-faces)
+
+(defface post-bold-face
+  '((((class color)
+      (background light))
+     (:bold t))
+    (((class color)
+      (background dark))
+     (:bold t))
+    (t
+     (:bold t)))
+  "Face used for text matching post-bold-pattern."
+  :group 'post-faces)
+
+(defface post-underline-face
+  '((((class color)
+      (background light))
+     (:underline t))
+    (((class color)
+      (background dark))
+     (:underline t))
+    (t
+     (:underline t)))
+  "Face used for text matching post-underline-pattern."
+  :group 'post-faces)
+
+; Note: some faces are added later!
+(defvar post-font-lock-keywords
+  `(("^\\([A-Z][-A-Za-z0-9.]+:\\)\\(.*\\)$"
+     (1 'post-header-keyword-face)
+     (2 'post-header-value-face))
+    ("^[ \t\f]*\\(>[ \t\f]*\\)\\([-a-zA-Z]*>[ \t\f]*\\)\\([-a-zA-Z]*>.*\\)$"
+     (1 'post-quoted-text-face)
+     (2 'post-double-quoted-text-face)
+     (3 'post-multiply-quoted-text-face))
+    ("^[ \t\f]*\\(>[ \t\f]*\\)\\([-a-zA-Z]*>.*\\)$"
+     (1 'post-quoted-text-face)
+     (2 'post-double-quoted-text-face))
+    ("^[ \t\f]*\\(>[ \t\f]*[^ \t\f\n>].*\\)$"
+     (1 'post-quoted-text-face))
+    ("^[ \t\f]*\\(>[ \t\f]*\\)$"
+     (1 'post-quoted-text-face))
+	(,post-email-address-pattern
+	 (0 'post-email-address-text-face)))
+  "Highlighting rules for message mode.")
+
+;;; Declare global mode variables.
+
+(defconst post-font-lock-syntactic-keywords
+  `((,(concat "^" post-signature-pattern "[ \t\f]*$") 0 '(11))))
+
+(defun post-font-lock-syntactic-face-function (state)
+  "Function for font locking syntactic faces.
+Argument STATE ."
+post-signature-text-face)
+
+(defvar post-buf nil
+  "Name of the composing buffer.")
+
+(defvar post-select-signature-mode-map nil
+  "Local keymap for the select-signature buffer.")
+
+(defvar post-select-signature-last-buffer nil
+  "Pointer to the calling buffer.")
+
+(defvar post-select-signature-last-point nil
+  "Where we were in the calling buffer.")
+
+(defvar post-has-attachment nil
+ "Whether the message has an attachment.")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Interactive Commands
+
+(defun post-save-current-buffer-and-exit ()
+  "Save the current buffer and exit Emacs."
+  (interactive)
+
+  ;; Should the user be prompted for an attachment?
+  (cond (post-has-attachment)
+	((equal post-should-prompt-for-attachment 'Never))
+	((or (equal post-should-prompt-for-attachment 'Always)
+	     (post-body-says-attach))
+	 (post-prompt-for-attachment)))
+
+  (basic-save-buffer)
+
+  (if post-backup-original
+      (kill-buffer "*Original*"))
+
+  (post-finish)
+
+  ;; Added by Rob Reid 10/13/1998 to prevent accumulating *Composing* buffers
+  ;; when using (emacs|gnu)client.  Helped by Eric Marsden's Eliza example in
+  ;; http://www.ssc.com/lg/issue29/marsden.html
+  (kill-buffer post-buf))
+
+(defun post-goto-body ()
+  "Go to the beginning of the message body."
+  (interactive)
+  (goto-char (point-min))
+  ;; If the message has header, slide downward.
+  (and header-mode (save-match-data (re-search-forward "^$" nil t))
+       (next-line 1)))
+
+(defun post-goto-signature ()
+  "Go to the beginning of the message signature."
+  (interactive)
+  (goto-char (point-max))
+  (and (save-match-data
+	 (re-search-backward (concat "^" post-signature-pattern
+				     "[ \t\f]*$")
+			     nil t))))
+
+(defun post-delete-quoted-signatures ()
+  "Delete quoted signatures from buffer."
+  (interactive)
+  (goto-char (point-min))
+  (flush-lines (concat "^\\([ \t\f]*>[ \t\f>]*\\)"
+		       post-signature-pattern
+		       "[ \t\f]*\\(\n\\1.*\\)+")))
+
+(defun post-kill-signature ()
+  "Kill the signature from the buffer.
+Returns the point value for where the signature was or, if there isn't a
+signature, the point value of the end of the buffer"
+  (interactive)
+  (save-excursion
+    (goto-char (point-min))
+; The .=*+|#@!~$%&()_- is to compensate for people who put ASCII art on the
+; same line as the sigdashes, and the $ at the end prevents this from deleting
+; everything between mutt's standard forwarding lines.
+    (cond ((search-forward-regexp (concat "^" post-signature-pattern
+					  "[ \t\f.=*+|#@!~$%&()_-]*$") nil t)
+	   (beginning-of-line)
+	   (kill-region (point) (point-max)))
+	  (t
+	   (goto-char (point-max))))
+    (point)))
+
+(defun post-delete-old-citations ()
+  "Delete citations more than one level deep from buffer."
+  (interactive)
+  (goto-char (point-min))
+  (flush-lines "^[ \t\f]*>[ \t\f]*>[ \t\f>]*"))
+
+;;; Functions for messing with the body
+
+(defun post-make-region-bold (start end)
+  "Apply mutt's nroff style bold to a region of text.
+Argument START start of region.
+Argument END end of region."
+  (interactive "r")
+  (while (< start end)
+    (goto-char start)
+    (insert (buffer-substring-no-properties start (1+ start)))
+    (insert (char-to-string 8))
+    (setq start (+ start 3))
+    (setq end   (+ end   2))))
+
+(defun post-make-region-underlined (start end)
+  "Apply mutt's nroff style underline to a region of text.
+Argument START start of region.
+Argument END end of region."
+  (interactive "r")
+  (while (< start end)
+    (goto-char start)
+    (insert "_")
+    (insert (char-to-string 8))
+    (setq start (+ start 3))
+    (setq end   (+ end   2))))
+
+(defun post-quote-region (beg end)
+  "Quote a region using the `post-quote-start' variable.
+Argument BEG Beginning of region to be quoted.
+Argument END End of region to be quoted."
+  (interactive "r")
+  (comment-region beg end))
+
+(defun post-unquote-region (beg end)
+  "Un-quote a region one level using the `post-quote-start' variable.
+Argument BEG Beginning of region to be quoted.
+Argument END End of region to be quoted."
+  (interactive "r")
+  (uncomment-region beg end))
+
+; From Dave Pearson, July 15, 2000
+(defun* split-quoted-paragraph (&optional (quote-string "> "))
+  "Split a quoted paragraph at point, keeping the quote."
+  (interactive)
+  (if (save-excursion
+        (beginning-of-line)
+        (looking-at (regexp-quote quote-string)))
+      (progn
+        (let ((spaces (- (point)
+                         (save-excursion
+                           (beginning-of-line)
+                           (point))
+                         (length quote-string))))
+          (save-excursion
+            (insert (format "\n\n%s%s" quote-string (make-string spaces ? ))))))
+    (error "Can't see a quoted paragraph here")))
+
+(defun post-random-signature ()
+  "Randomize the signature.
+Set it to whatever `post-random-signature-command' spits out followed by the
+content of `post-fixed-signature-source', if available, or a nasty reminder if
+it is not."
+  (interactive)
+  (save-excursion
+    (goto-char (post-kill-signature))
+    (insert "-- \n")
+    (shell-command post-random-signature-command t)
+    (goto-char (point-max))
+    (if (file-readable-p post-fixed-signature-source)
+	(insert-file-contents post-fixed-signature-source)
+      (insert "I really need a `post-fixed-signature-source'!\n"))))
+
+(defun post-el-random-signature ()
+  "Choose a random signature from `post-variable-signature-source'.
+the signatures in `post-variable-signature-source' must be separated by
+`post-signature-sep-regexp'."
+  (interactive)
+  (let ((sig nil))
+    (save-excursion
+      (set-buffer (generate-new-buffer "*Post-Select-Signature*"))
+      (insert-file post-variable-signature-source)
+      (beginning-of-buffer)
+      ;; we have 2 lists of marks since seperators are of arbitrary lenght
+      (let ((marks-st (list (point-min)))
+	    (marks-end (list))
+	    (count 0))          ;nth counts from zero and random is [0,N)
+	(while (search-forward-regexp post-signature-sep-regexp nil "a")
+	  (setq marks-st (cons (match-end 0) marks-st)
+		marks-end (cons (match-beginning 0) marks-end)
+		count (1+ count)))
+	(setq marks-end (cons (point-max) marks-end))
+	(let ((r (random (1+ count))))
+	  (setq sig (buffer-substring-no-properties
+		     (nth r marks-st) (nth r marks-end))))
+	(kill-buffer (current-buffer)))
+      (goto-char (post-kill-signature))
+      (insert-string "-- \n")
+      (insert sig)
+      (if (file-readable-p post-fixed-signature-source)
+	  (insert-file-contents post-fixed-signature-source)
+	(insert "I really need a `post-fixed-signature-source'!\n")))))
+
+(defun post-select-signature-from-file ()
+  "*Interactively select a signature from `post-variable-signature-source'."
+  (interactive)
+  (setq post-select-signature-last-buffer (current-buffer))
+  (setq post-select-signature-last-point (point))
+  (pop-to-buffer "*Post-Select-Signature*")
+  (insert-file post-variable-signature-source)
+  (use-local-map post-select-signature-mode-map))
+
+(defun post-select-signature-select-sig-from-file ()
+ "*Chooses the signature the cursor is in from `post-variable-signature-source'."
+  (interactive)
+
+  ;; These 2 lines select whatever siglet the cursor is sitting in,
+  ;; making it nifty to C-s "word" then C-m (or whatever this is
+  ;; bound to).
+  (let ((sig-start (point))
+        (sig-end (point)))
+
+    (cond ((setq sig-start (search-backward-regexp post-signature-sep-regexp
+						   nil "a"))
+	   (forward-line 1)
+	   (setq sig-start (point))))
+
+    (if (search-forward-regexp post-signature-sep-regexp nil "a")
+	(setq sig-end (match-beginning 0))
+      (setq sig-end (point-max)))
+
+    (let ((sig (buffer-substring-no-properties sig-start sig-end)))
+      (switch-to-buffer post-select-signature-last-buffer)
+      (goto-char (post-kill-signature))
+      (insert-string "-- \n")
+      (insert sig))
+    (if (file-readable-p post-fixed-signature-source)
+	(insert-file-contents post-fixed-signature-source))
+    (post-select-signature-quit)))
+
+(defun post-select-signature-from-dir ()
+  "Select a new signature for an email/post in the current buffer."
+  (interactive)
+  (setq post-select-signature-last-buffer (current-buffer))
+  (setq post-select-signature-last-point (point))
+  (pop-to-buffer "*Post-Select-Signature*")
+  (list-directory (concat post-signature-directory
+                          post-signature-wildcard) t)
+  (pop-to-buffer "*Directory*")
+  (next-line 1)
+  (copy-to-buffer "*Post-Select-Signature*" (point) (point-max))
+  (kill-buffer "*Directory*")
+  (pop-to-buffer "*Post-Select-Signature*")
+  (use-local-map post-select-signature-mode-map)
+  (toggle-read-only t))
+
+(defun post-select-signature-select-sig-from-dir ()
+  "Set the signature in the calling buffer to the one under the cursor."
+  (interactive)
+  (let ((sig-start   nil)
+        (sig-to-load nil))
+    (end-of-line)
+    (search-backward " ")
+    (forward-char)
+    (setq sig-start (point))
+    (end-of-line)
+    (setq sig-to-load (buffer-substring-no-properties sig-start (point)))
+    (switch-to-buffer post-select-signature-last-buffer)
+    (goto-char (post-kill-signature))
+    (insert-string "-- \n")
+    (insert-file (concat post-signature-directory sig-to-load))
+    (message "Signature set to %s%s" post-signature-directory sig-to-load)
+    (post-select-signature-quit)))
+
+(defun post-select-signature-quit ()
+  "Kill the *Post-Select-Signature* frame."
+  (interactive)
+  (kill-buffer "*Post-Select-Signature*")
+  (switch-to-buffer post-select-signature-last-buffer)
+  (goto-char post-select-signature-last-point)
+  (delete-other-windows))
+
+;;; Non-interactive functions
+
+(defun post-ask-for-address-with-default (header)
+  "Prompt for an email address, showing default.
+Argument HEADER the header type."
+  (let ((default (if (= (length (post-get-header-value header)) 0)
+                     post-email-address
+                   (post-get-header-value header))))
+    (read-string (concat header ": ") default)))
+
+; From davep@davep.org.  RR hasn't tested it.
+(defun post-get-header-value (header)
+  "Get the value of a specific mail HEADER."
+  (save-excursion
+    (let ((value          "")
+          (start-of-value nil))
+      (setf (point) (point-min))
+      (when (post-find-header-line header)
+        (setq start-of-value (point))
+        (end-of-line)
+        (setq value (buffer-substring-no-properties start-of-value (point))))
+      value)))
+
+;;; From davep@davep.org.  RR hasn't tested it.
+(defun post-find-header-line (header)
+  "Find a HEADER line in the header."
+  (let ((old-point (point))
+        (end-of-header nil)
+        (found-point nil))
+    (setf (point) (point-min))
+    (search-forward-regexp "^$" nil t)
+    (setq end-of-header (point))
+    (setf (point) (point-min))
+    (cond ((search-forward-regexp (concat "^" header ": ") nil t)
+           (cond ((< (point) end-of-header)
+                  (setq found-point (point)))
+                 (t
+                  (setf (point) old-point))))
+          (t
+           (setf (point) old-point)))
+    found-point))
+
+;;; Function to make a backup buffer for viewing the original.
+(defun post-copy-original ()
+  "Make a copy of the `post-mode' buffer before any editing by the user.
+This way they can refer back to this buffer during a compose session."
+  (copy-to-buffer (get-buffer-create "*Original*")
+		  (point-min) (point-max)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; The Heart of Darkness
+;;;
+;;; The old post mode (i.e. Dave Pearson's) derived from mail-mode.  I
+;;; prefer deriving from text mode like mutt mode did. - RR
+(define-derived-mode post-mode text-mode "Post"
+  "Major mode for composing email or news with an external agent.
+To customize it, type \\[customize] and select [Applications] [Mail] [Post].
+When you finish editing this message, type \\[post-save-current-buffer-and-exit] to save and exit Emacs.
+
+\\{post-mode-map}"
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Neat things to do right off the bat.
+
+  (auto-fill-mode (if post-uses-fill-mode 1 0))
+
+  (if post-backup-original (post-copy-original))
+
+  ;; Make Emacs smarter about wrapping citations and paragraphs.
+  ;; We probably can't handle Supercited messages, though.
+  (make-local-variable 'paragraph-start)
+  (make-local-variable 'paragraph-separate)
+  (setq paragraph-start
+	"\\([ \t\n\f]+[^ \t\n\f>]\\|[ \t\f>]*$\\)"
+	paragraph-separate
+	"[ \t\f>]*$")
+
+  ;; XEmacs needs easy-menu-add, Emacs does not care
+  (easy-menu-add post-mode-menu)
+
+  ;; If headers were passed, activate the necessary commands.
+  (when (looking-at "^[-A-Za-z0-9]+:")
+    (header-mode 1))
+
+  ;; Our temporary file lives in /tmp. Yuck! Compensate appropriately.
+  (make-local-variable 'backup-inhibited)
+  (setq backup-inhibited t)
+
+  (if (boundp 'font-lock-defaults)
+      (make-local-variable 'font-lock-defaults))
+  (flet ((add-syntax-highlight (face regexps)
+	    (set face face)
+	    (nconc post-font-lock-keywords
+		   (loop for regexp in regexps
+			 collect (list regexp (list 0 face 't))))))
+;			 collect (list regexp `(,0 ',face))))))
+    (add-syntax-highlight 'post-emoticon-face post-emoticon-pattern)
+    (add-syntax-highlight 'post-bold-face   post-bold-pattern)
+    (add-syntax-highlight 'post-underline-face   post-underline-pattern)
+    (add-syntax-highlight 'post-url-face    post-url-pattern))
+  (setq font-lock-defaults
+	'(post-font-lock-keywords nil nil nil nil
+				  (font-lock-syntactic-keywords
+				   . post-font-lock-syntactic-keywords)
+				  (font-lock-comment-face
+;				   . 'post-signature-text-face)))
+				   . post-signature-text-face)))
+
+  ;; Force pwd to home directory if so required.
+  (cond (post-force-pwd-to-home
+	 (cd "~")))
+
+  ;; Kill quoted sig if so required.
+  (cond (post-kill-quoted-sig
+	 (post-delete-quoted-signatures)
+         (not-modified)))
+
+  ;; Remap signature selection functions according to whether the
+  ;; signatures are stored in a file or directory.
+  (if post-signature-source-is-file
+      (progn
+	(defalias 'post-select-signature 'post-select-signature-from-file)
+	(defalias 'post-select-signature-select-sig
+	  'post-select-signature-select-sig-from-file))
+    (progn
+      (defalias 'post-select-signature 'post-select-signature-from-dir)
+      (defalias 'post-select-signature-select-sig
+	'post-select-signature-select-sig-from-dir)))
+
+  ;; Define mutt/slrn specific key bindings.
+  (define-key (current-local-map) "\C-c\C-b"	 'post-make-region-bold)
+  (define-key (current-local-map) "\C-c\C-u"	 'post-make-region-underlined)
+  (define-key (current-local-map) "\C-c\C-q"	 'post-quote-region)
+  (define-key (current-local-map) "\C-c\C-d\C-q" 'post-unquote-region)
+  (define-key (current-local-map) "\C-c\C-a"	 'post-attach-file)
+  (define-key (current-local-map) "\C-c\C-p"	 'post-set-return-receipt-to)
+
+  ;; Give the buffer a handy name.
+  (if post-rename-buffer
+      (setq post-buf (rename-buffer "*Composing*" t)))
+ 
+  ;; If this is a news posting, check the length of the References field.
+  (if (post-references-p)
+      (header-check-references))
+
+  ;; Define the quote signs as comments to make comment-region usable.
+  (make-local-variable 'comment-start)
+  (setq comment-start post-quote-start)
+
+  ;; Run any hooks.
+  (run-hooks 'post-mode-hook)
+
+  ;; Jump past header if so required.
+  (cond (post-jump-header
+         (post-goto-body)))
+
+  (unless (fboundp 'server-process-filter)
+    (message (substitute-command-keys
+     "Type \\[describe-mode] for help composing; \\[post-save-current-buffer-and-exit] when done."))))
+
+(defun post-references-p ()
+  "Is there a References header in this buffer?"
+  (save-excursion
+    (goto-char (point-min))
+    (looking-at "^References: ")))
+
+(defun post-body-says-attach ()
+  "Check if attach appears in the body."
+  (post-goto-body)
+  
+  ;; Aargh it's annoying that how-many returns a string,
+  ;; "13 occurences" instead of a number, 13.
+  (let ((total-attach (string-to-int (how-many post-attachment-regexp))))
+    ;; And this mess is just to catch the unlikely false alarm of
+    ;; "attach" being in the signature, but not in the body.
+    (if (> total-attach 0)
+	(progn (post-goto-signature)
+	       (> total-attach (string-to-int (how-many
+					       post-attachment-regexp)))))))
+
+(defun post-prompt-for-attachment ()
+  "Prompt for an attachment."
+   (if (y-or-n-p "Do you want to attach anything? ")
+       (let ((file (read-file-name "Attach file: " nil nil t nil))
+	     (description (string-read "Description: ")))
+	 (header-attach-file file description))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Post Header Mode
+
+(defvar header-mode nil)
+
+(defun header-mode (&optional arg)
+  "Commands for editing the header of an e-mail or news message.
+
+\\{header-mode-map}
+Optional argument ARG ."
+
+  (interactive "P")
+  (make-local-variable 'header-mode)
+  (setq header-mode
+	(if (null arg)
+	    (not header-mode)
+	  (> (prefix-numeric-value arg) 0)))
+  (setq post-has-attachment nil)
+
+  ;; XEmacs needs easy-menu-add, Emacs does not care
+  (easy-menu-add header-mode-menu)
+
+  (force-mode-line-update))
+
+(defvar header-mode-map (make-sparse-keymap)
+  "Keymap used for editing RFC822 header.")
+
+(defun header-position-on-value ()
+  "Go to the start of the value part of a header."
+  (beginning-of-line)
+  (skip-chars-forward "-A-Za-z0-9:")
+  ;; XXX - Should make sure we stay on line.
+  (forward-char)
+  (point))
+
+(defun header-goto-field (field)
+  "Go to FIELD of a header."
+  (let ((case-fold-search t))
+    (goto-char (point-min))
+    (save-match-data
+      (when (re-search-forward (concat "^\\($\\|" field ": \\)"))
+	(if (looking-at "^$")
+	    (progn
+	      (insert-string field ": \n")
+	      (forward-char -1))
+	  (header-position-on-value))))))
+
+(defmacro define-header-goto (name header)
+  "Define functions called NAME to go to HEADER."
+  `(defun ,name ()
+     ,(concat "Position the cursor on the " header ": header.")
+     (interactive)
+     (header-goto-field ,header)))
+
+(define-header-goto header-goto-to "To")
+(define-header-goto header-goto-cc "Cc")
+(define-header-goto header-goto-fcc "Fcc")
+(define-header-goto header-goto-summary "Summary")
+(define-header-goto header-goto-keywords "Keywords")
+(define-header-goto header-goto-subject "Subject")
+(define-header-goto header-goto-bcc "Bcc")
+(define-header-goto header-goto-reply-to "Reply-To")
+(define-header-goto header-goto-from "From")
+(define-header-goto header-goto-organization "Organization")
+
+(defun header-attach-file (file description)
+  "Attach a FILE to the current message (works with Mutt).
+Argument DESCRIPTION MIME description."
+  (interactive "fAttach file: \nsDescription: ")
+  (when (> (length file) 0)
+    (save-excursion
+      (save-match-data
+	(save-restriction
+	  (widen)
+	  (goto-char (point-min))
+	  (search-forward-regexp "^$")
+	  (insert-string (concat "Attach: " (file-truename file) " "
+				 description "\n"))
+	  (message (concat "Attached '" file "'."))
+	  (setq post-has-attachment t))))))
+
+(or (assq 'header-mode minor-mode-alist)
+    (setq minor-mode-alist
+	  (cons '(header-mode " Header") minor-mode-alist)))
+
+(or (assq 'header-mode minor-mode-map-alist)
+    (setq minor-mode-map-alist
+	  (cons (cons 'header-mode header-mode-map)
+		minor-mode-map-alist)))
+
+(defun header-set-return-receipt-to (address)
+  "Insert a Return-Receipt-To header into an email.
+Argument ADDRESS email address return receipts should be sent to."
+  (interactive (list (post-ask-for-address-with-default "Return-Receipt-To")))
+  (save-excursion
+    (header-set-value "Return-Receipt-To" address)))
+
+(defun post-news-posting-p ()
+  "Does the buffer look like a news posting?"
+  (save-excursion
+    (setf (point) (point-min))
+    (looking-at "^Newsgroups: ")))
+
+(defun header-set-followup-to (to)
+  "Set the Followup-To: header.
+Argument TO Where followups should go."
+  (interactive (list (header-ask-for-value "Followup-To"
+					   (header-ask-for-value
+					    "Newsgroups"))))
+  (cond ((post-news-posting-p)
+	 (save-excursion
+	   (header-set-value "Followup-To" to)))
+	(t
+	 (error
+  "Followup-To is for Usenet.  Maybe you want Reply-To or Mail-Followup-To"))))
+
+(defun header-set-organization (org)
+  "Set the Organization: header.
+Argument ORG Should be SMERSH."
+  (interactive (list (header-ask-for-value "Organization")))
+  (save-excursion
+    (header-set-value "Organization" org)))
+
+(defun header-check-references ()
+  "Place the cursor at the start of the References: if they are too long."
+  (interactive)
+  (cond ((> (header-references-length) 500) ; 500 to be on the safe side.
+         (beep)                              ; Catch my attention.
+         (goto-char (point-min))
+         (search-forward-regexp "^References: " nil t))))
+
+(defun header-references-length (&optional show)
+  "Get (and optionally display) the length of the references header.
+Optional argument SHOW Whether or not to display the length."
+  (interactive)
+  (let* ((header "References")
+         (refs (header-get-value header))
+         (len (+ (length header) (length refs) 2)))
+    (if (or (interactive-p) show)
+        (message "References header is %d characters in length." len))
+    len))
+
+(defun header-delete-reference ()
+  "Delete the first reference in the references header."
+  (interactive)
+  (save-excursion
+    (let ((ref-location (header-goto-field "References")))
+      (cond (ref-location
+             (let ((ref-start (goto-char ref-location)))
+               (cond ((search-forward ">" nil t)
+                      (forward-char 1)
+                      (delete-region ref-start (point))
+                      (header-references-length t)))))))))
+
+;; Noninteractive functions.
+
+(defun header-ask-for-value (header &optional default)
+  "Ask for a HEADER value, defaulting to the current value if one is present.
+Optional argument DEFAULT ."
+  (let ((new-value (post-get-header-value header)))
+    (and (= (length new-value) 0)
+         default
+         (setq new-value default))
+    (read-string (concat header ": ") new-value)))
+
+(defun header-get-value (header)
+  "Get the value of a specific mail HEADER."
+  (save-excursion
+    (let ((value          "")
+          (start-of-value nil))
+      (goto-char (point-min))
+      (cond ((post-find-header-line header)
+             (setq start-of-value (point))
+             (end-of-line)
+             (setq value (buffer-substring-no-properties
+			  start-of-value (point)))))
+      value)))
+
+(defun header-set-value (header value)
+  "Set VALUE of a HEADER (replacing any existing value)."
+  (let ((kill-ring kill-ring))
+    (setf (point) (point-min))
+    (cond ((post-find-header-line header)
+	   (beginning-of-line)
+	   (kill-line)
+	   (insert-string (concat header ": " value)))
+	  (t
+	   (header-append-value header value))))
+  (message "%s set to %s" header value))
+
+(defun header-append-value (header value)
+  "Add a HEADER and set it's VALUE (if header exists, will add multiple headers)."
+  (goto-char (point-min))
+  (search-forward-regexp "^$" nil t)
+  (insert-string (concat header ": " value "\n")))
+
+;;; Setup the mode map for the select-signature buffer.
+(if post-select-signature-mode-map nil
+  (setq post-select-signature-mode-map (make-sparse-keymap))
+  (define-key post-select-signature-mode-map "\C-m"
+    'post-select-signature-select-sig)
+  (define-key post-select-signature-mode-map " "
+    'post-select-signature-select-sig)
+  (define-key post-select-signature-mode-map "q" 'post-select-signature-quit)
+  (define-key post-select-signature-mode-map "\C-g"
+    'post-select-signature-quit))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Key Bindings
+
+(define-key post-mode-map "\C-c\C-c" 'post-save-current-buffer-and-exit)
+(define-key post-mode-map "\C-c\C-d\C-s" 'post-delete-quoted-signatures)
+(define-key post-mode-map "\C-c\C-d\C-c" 'post-delete-old-citations)
+(define-key post-mode-map "\C-c\C-t" 'post-goto-body)
+(define-key post-mode-map "\C-c\C-e" 'post-goto-signature)
+(define-key post-mode-map "\C-c\C-r" 'post-random-signature)
+(define-key post-mode-map "\C-c\C-b" 'post-make-region-bold)
+(define-key post-mode-map "\C-c\C-u" 'post-make-region-underlined)
+(define-key post-mode-map "\C-c\C-q" 'post-quote-region)
+(define-key post-mode-map "\C-c\C-d\C-q" 'post-unquote-region)
+(define-key post-mode-map "\C-c\C-s" 'post-select-signature)
+
+(define-key header-mode-map "\C-c\C-f\C-t" 'header-goto-to)
+(define-key header-mode-map "\C-c\C-f\C-c" 'header-goto-cc)
+(define-key header-mode-map "\C-c\C-f\C-w" 'header-goto-fcc)
+(define-key header-mode-map "\C-c\C-f\C-u" 'header-goto-summary)
+(define-key header-mode-map "\C-c\C-f\C-k" 'header-goto-keywords)
+(define-key header-mode-map "\C-c\C-f\C-s" 'header-goto-subject)
+(define-key header-mode-map "\C-c\C-f\C-b" 'header-goto-bcc)
+(define-key header-mode-map "\C-c\C-f\C-r" 'header-goto-reply-to)
+(define-key header-mode-map "\C-c\C-f\C-f" 'header-goto-from)
+(define-key header-mode-map "\C-c\C-f\C-o" 'header-goto-organization)
+(define-key header-mode-map "\C-c\C-ff"    'header-set-followup-to)
+(define-key header-mode-map "\C-c\C-a"     'header-attach-file)
+(define-key header-mode-map "\C-c\C-fd"    'header-delete-reference)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Menus
+
+(easy-menu-define
+ post-mode-menu post-mode-map "Post Message Composition Commands."
+ '("Post"
+   ["Delete quoted signatures" post-delete-quoted-signatures t]
+   ["Delete doubly quoted text" post-delete-old-citations t]
+   "----"
+   ["Go to body of message" post-goto-body t]
+   ["Go to signature of message" post-goto-signature t]
+   ["Get new random signature" post-random-signature t]
+   ["Select new signature" post-select-signature t]
+   "----"
+   ["Embolden region" post-make-region-bold t]
+   ["Underline region" post-make-region-underlined t]
+   "----"
+   ["Quote region" post-quote-region t]
+   ["Unquote region" post-unquote-region t]
+   "----"
+   ["Save message and return from Post" post-save-current-buffer-and-exit t]))
+
+(easy-menu-define
+ header-mode-menu header-mode-map "Header Editing Commands."
+ '("Header"
+   ["Attach File..." header-attach-file t]
+   "----"
+   ["Edit From Header" header-goto-from t]
+   ["Edit Subject Header" header-goto-subject t]
+   ["Edit To Header" header-goto-to t]
+   ["Edit Cc Header" header-goto-cc t]
+   ["Edit Bcc Header" header-goto-bcc t]
+   ["Edit Fcc Header" header-goto-fcc t]
+   ["Edit Reply-To Header" header-goto-reply-to t]
+   ["Edit Summary Header" header-goto-summary t]
+   ["Edit Keywords Header" header-goto-keywords t]
+   ["Edit Organization Header" header-goto-organization t]))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Finish Installing Post Mode
+
+(when post-insert-to-auto-mode-alist-on-load
+  (unless (assq post-mail-message auto-mode-alist)
+    (setq auto-mode-alist
+	  (cons (cons post-mail-message 'post-mode)
+		auto-mode-alist)))
+  (unless (assq post-news-posting auto-mode-alist)
+    (setq auto-mode-alist
+	  (cons (cons post-news-posting 'post-mode)
+		auto-mode-alist))))
+
+(provide 'post)
+
+;;; post.el ends here

+ 124 - 0
.mailfilter

@@ -0,0 +1,124 @@
+# .Mailfilter - rules for maildrop
+
+MAILDIR="/home/manu/Mail/imap"
+
+VERBOSE=9
+
+logfile "/home/manu/logs/maildrop/maildrop.log"
+
+########### debian lists ###############
+if (/^List-Id: <debian-user-french.lists.debian.org>$/)
+        to $MAILDIR/.my.ml.debian.user-french
+if (/^List-Id: <debian-devel-french.lists.debian.org>$/)
+        to $MAILDIR/.my.ml.debian.devel-french
+if (/^List-Id: <debian-devel.lists.debian.org>$/)
+        to $MAILDIR/.my.ml.debian.devel
+if (/^List-Id: <debian-security-announce.lists.debian.org>$/ || /^To:.*debian-security@lists.debian.org.*$/ || /^Cc:.*debian-security@lists.debian.org.*$/)
+        to $MAILDIR/.my.ml.debian.security
+if (/^Cc:.*asso@france.debian.net.*$/ || /^To:.*asso@france.debian.net.*$/)
+        to $MAILDIR/.my.ml.debian.france.asso
+if (/^Cc:.*sl@france.debian.net.*$/ || /^To:.*sl@france.debian.net.*$/)
+        to $MAILDIR/.my.ml.debian.france.sl
+if (/^List-Id: <debian-devel-announce.lists.debian.org>$/)
+        to $MAILDIR/.my.ml.debian.devel-announce
+if (/^List-Id: <debian-mentors.lists.debian.org>$/)
+        to $MAILDIR/.my.ml.debian.mentors
+if (/^List-Id: <debian-announce.lists.debian.org>$/)
+        to $MAILDIR/.my.ml.debian.announce
+if (/^List-Id: <debian-devel-changes.lists.debian.org>$/)
+        to $MAILDIR/.my.ml.debian.devel-changes
+
+########### hurd lists ###############
+if (/^List-Id: <debian-hurd.lists.debian.org>$/)
+        to $MAILDIR/.my.ml.hurd.debian
+if (/^List-Id:.*<hurdfr.hurdfr.org>$/)
+        to $MAILDIR/.my.ml.hurd.hurdfr
+if (/^List-Id:.*<l4-hurd.gnu.org>$/)
+        to $MAILDIR/.my.ml.hurd.l4
+
+########### asyd lists ###############
+if (/^List-Id:.*<sysadmin.asyd.net>.*$/)
+        to $MAILDIR/.my.ml.asyd.sysadmin
+
+if (/^List-Id:.*<shell.asyd.net>.*$/)
+        to $MAILDIR/.my.ml.asyd.shell
+
+if (/^List-Id:.*<emacs.asyd.net>.*$/)
+        to $MAILDIR/.my.ml.asyd.emacs
+
+########### abul lists ###############
+if (/^List-Id: <asso.abul.org>$/ || /^To:.*asso@abul.org.*$/ || /^Cc:.*asso@abul.org.*$/)
+        to $MAILDIR/.my.ml.abul.asso
+
+if (/^List-Id: <tech.abul.org>$/ || /^To:.*tech@abul.org.*$/ || /^Cc:.*tech@abul.org.*$/)
+        to $MAILDIR/.my.ml.abul.tech
+
+if (/^List-Id: <devel.abul.org>$/ || /^To:.*devel@abul.org.*$/ || /^Cc:.*devel@abul.org.*$/)
+        to $MAILDIR/.my.ml.abul.devel
+
+if (/^List-Id: <debutants.abul.org>$/ || /^To:.*debutants@abul.org.*$/ || /^Cc:.*debutants@abul.org.*$/)
+        to $MAILDIR/.my.ml.abul.debutants
+
+if (/^List-Id: <party.abul.org>$/ || /^To:.*party@abul.org.*$/ || /^Cc:.*party@abul.org.*$/)
+        to $MAILDIR/.my.ml.abul.party
+
+if (/^List-Id: <annonces.abul.org>$/ || /^To:.*annonces@abul.org.*$/ || /^Cc:.*annonces@abul.org.*$/)
+        to $MAILDIR/.my.ml.abul.annonces
+
+if (/^List-Id: <blahblah.abul.org>$/ || /^To:.*blahblah@abul.org.*$/ || /^Cc:.*blahblah@abul.org.*$/)
+        to $MAILDIR/.my.ml.abul.blahblah
+
+########### lna lists ###############
+if (/^X-Original-To: linuxaction@tux.linux-nantes.fr.eu.org$/ || /^To:.*linuxaction@linux-nantes.org.*$/ || /^Cc:.*linuxaction@linux-nantes.org.*$/)
+        to $MAILDIR/.my.ml.lna.action
+
+########### gulliver lists ###############
+if (/^List-Id:.*gulliver@listes.linux-france.org.*$/ || /^List-Id:.*gulliver.listes.linux-france.org.*$/)
+        to $MAILDIR/.my.ml.gulliver.gulliver
+
+########### WeeChat lists ###############
+if (/^List-Id: weechat-cvs.nongnu.org$/)
+        to $MAILDIR/.my.soft.weechat.ml.cvs
+if (/^List-Id: weechat-dev.nongnu.org$/ || /^To:.*weechat-dev@nongnu.org/)
+        to $MAILDIR/.my.soft.weechat.ml.devel
+
+########### Kde Devel ###############
+if (/^From:.*kde.org$/)
+        to $MAILDIR/.my.soft.kde
+
+########### Misc Stuff ###############
+if (/^From:.*logcheck@/ || /^Subject:.*rkhunter/)
+        to $MAILDIR/.sys.reports
+
+########### Tiac Info ###############
+if (/^Subject:.*[tT][iI][aA][cC].*[iI][nN][fF][oO]/)
+{
+    to $MAILDIR/.friends.tbs.tiacfooting
+}
+
+########## PUB :-( ####################
+if (/^From:.*laredoute@fr.redoute.com/)
+{
+    to $MAILDIR/.Trash
+}
+
+########### Spam ###############
+#xfilter "bogofilter -u -e -p"
+#if (/^X-Bogosity:.*Spam/ && !/^X-Bogosity:.*Ham/ && !/^X-Bogosity:.*Unsure/)
+#{
+#    to $MAILDIR/.Spam
+#}
+
+xfilter "spamc"
+if (/^X-Spam-Status: YES/)
+{
+    to $MAILDIR/.Spam
+}
+
+if (!/^From:.*/)
+{
+    to $MAILDIR/.Spam
+}
+
+to $MAILDIR/
+

+ 11 - 0
.muttng/conf/aliases

@@ -0,0 +1,11 @@
+#
+# -*- muttrc -*-
+#
+# Mutt configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Aliases settings for Mutt.
+#

+ 89 - 0
.muttng/conf/colors

@@ -0,0 +1,89 @@
+# -*- muttngrc -*-
+#
+# Muttng configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Colors settings for muttng.
+#
+
+# Default colour definitions
+color normal     default      default
+color message    brightwhite  default
+color status     brightyellow cyan
+color hdrdefault cyan         default
+color indicator	 brightwhite  magenta
+
+
+color quoted   cyan      default
+color quoted1  yellow    default
+color quoted2  brightred default
+color quoted3  cyan      default
+color quoted4  yellow    default
+color quoted5  brightred default
+color quoted6  cyan      default
+color quoted7  yellow    default
+color quoted8  brightred default
+
+
+color signature  white       default
+color tilde      white       default
+color tree       brightred   default
+color attachment brightgreen default
+# color error      red          white
+# color search     brightwhite  magenta
+
+# color bold       brightyellow white
+# color markers    red          white
+
+# Colour definitions when on a mono screen
+mono bold      bold
+mono underline underline
+mono indicator reverse
+
+# Colours for items in the reader
+color header yellow  default "^From\:|^To\:|^Cc\:|\Bcc\:"
+color header magenta default "^Date\:"
+color header blue    default "^Reply-To\:"
+color header red     default "\Subject\:"
+
+# Colours for items in the index
+color index green     default ~N           # New messages.
+color index green     default ~O           # Old messages.
+color index brightred default ~D           # Deletes messages.
+# color index brightgreen white "~N (~x hagbard\.davep\.org | ~h \"^In-[Rr]eply-[Tt]o: .*hagbard\.davep\.org\")"
+# color index red         white ~F
+# color index black       green ~T
+# mono  index bold              ~N
+# mono  index bold              ~F
+# mono  index bold              ~T
+# mono  index bold              ~D
+
+# Highlights inside the body of a message.
+
+# URLs
+color body green default "(http|https|ftp|news|telnet|finger)://[^ \">\t\r\n]*"
+color body green default "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
+color body green default "news:[^ \">\t\r\n]*"
+
+mono  body bold	 "(http|https|ftp|news|telnet|finger)://[^ \">\t\r\n]*"
+mono  body bold  "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
+mono  body bold  "news:[^ \">\t\r\n]*"
+
+# email addresses
+color body green default "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
+mono  body bold          "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
+
+# Various smilies
+color body brightred default "<[Gg]>"                                            # <g>
+color body brightred default "<[Bb][Gg]>"                                        # <bg>
+color body brightred default " [;:]-*[)>(<|]"                                    # :-) etc...
+color body brightred default "(^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$)" # *Bold* text.
+color body brightred default "(^|[[:space:]])_[^[:space:]]+_([[:space:]]|$)"     # _Underlined_ text.
+color body brightred default "(^|[[:space:]])/[^[:space:]]+/([[:space:]]|$)"     # /Italic/ text.
+
+# Sidebar color
+color sidebar_new brightred default
+color sidebar cyan default

+ 61 - 0
.muttng/conf/headers

@@ -0,0 +1,61 @@
+# -*- muttngrc -*-
+#
+# Muttng configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Headers settings for Muttng.
+#
+
+# Ignore all headers
+ignore *
+
+# Then un-ignore the ones I want to see
+unignore From:
+unignore Subject:
+unignore To:
+unignore Cc:
+unignore Bcc:
+unignore Return-Path:
+unignore Reply-To:
+unignore Mail-Followup-To:
+unignore Followup-To:
+unignore Date:
+unignore Organization:
+unignore User-Agent:
+unignore X-Mailer:
+unignore X-Newsreader:
+unignore Newsgroups:
+unignore Summary:
+unignore Keywords:
+unignore Mail-Copies-To:
+unignore Sender:
+unignore X-Sent:
+unignore X-Mailman-Version:
+unignore Posted-To:
+unignore Mail-Copies-To:
+unignore Apparently-To:
+unignore Gnus-Warning:
+unignore Resent-From:
+unignore X-Accept-Language:
+unignore gpg-key-ID:
+unignore X-GPG-Fingerprint:
+unignore X-PGP-Fingerprint:
+unignore X-GnuPG-KeyID:
+unignore fingerprint:
+unignore X-Spam-Status:
+unignore X-Junked-Because:
+unignore X-SpamProbe:
+unignore X-Virus-hagbard:
+unignore X-Originating-IP:
+unignore X-Originating-Email:
+unignore X-Bogosity:
+unignore X-Operating-System:
+unignore X-Apparently-From:
+
+# Now order the visable header lines
+hdr_order From: Subject: To: Cc: Bcc: Return-Path: Reply-To: Mail-Followup-To: Followup-To: Date: Organization: User-Agent: X-Mailer: X-Newsreader: Newsgroups: Summary: Keywords: Mail-Copies-To: Sender: X-Sent: X-Mailman-Version: Posted-To: Mail-Copies-To: Apparently-To: Gnus-Warning: Resent-From: X-Accept-Language: gpg-key-ID: X-GPG-Fingerprint: fingerprint: X-Spam-Status: X-Junked-Because: X-SpamProbe: X-Virus-hagbard: X-Originating-IP: X-Originating-Email:
+
+

+ 35 - 0
.muttng/conf/identities

@@ -0,0 +1,35 @@
+# -*- muttngrc -*-
+#
+# Muttng configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Identities settings for Muttng.
+#
+
+#folder-hook . set signature="~/.signatures/kolter_openics"
+#folder-hook . my_hdr From: Emmanuel Bouthenot <kolter@openics.org>
+
+folder-hook weechat\.ml.*|ml\.debian.*|ml\.hurd\.hurdfr|ml\.abul.*|ml\.lna.*|ml\.asyd.*|ml\.gulliver.* my_hdr Reply-To: kolter@openics.org
+folder-hook weechat\.ml.*|ml\.debian.*|ml\.hurd\.hurdfr|ml\.abul.*|ml\.lna.*|ml\.asyd.*|ml\.gulliver.* my_hdr User-Agent: $user_mua
+folder-hook weechat\.ml.*|ml\.debian.*|ml\.hurd\.hurdfr|ml\.abul.*|ml\.lna.*|ml\.asyd.*|ml\.gulliver.* my_hdr X-Operating-System: $user_os
+folder-hook weechat\.ml.*|ml\.debian.*|ml\.hurd\.hurdfr|ml\.abul.*|ml\.lna.*|ml\.asyd.*|ml\.gulliver.* my_hdr X-GnuPG-KeyID: $user_gpg_id
+folder-hook weechat\.ml.*|ml\.debian.*|ml\.hurd\.hurdfr|ml\.abul.*|ml\.lna.*|ml\.asyd.*|ml\.gulliver.* my_hdr X-GPG-Fingerprint: $user_gpg_fprint
+folder-hook weechat\.ml.*|ml\.debian.*|ml\.hurd\.hurdfr|ml\.abul.*|ml\.lna.*|ml\.asyd.*|ml\.gulliver.* set signature="~/.signatures/kolter_openics"
+
+folder-hook weechat\.ml.*	my_hdr From: kolter <kolter+dev@openics.org>
+folder-hook ml\.debian.* 	my_hdr From: Emmanuel Bouthenot <kolter+deb@openics.org>
+folder-hook ml\.hurd\.hurdfr	my_hdr From: Emmanuel Bouthenot <kolter+hurd@openics.org>
+folder-hook ml\.abul.*		my_hdr From: Emmanuel Bouthenot <kolter+abul@openics.org>
+folder-hook ml\.lna.*		my_hdr From: Emmanuel Bouthenot <kolter+lna@openics.org>
+folder-hook ml\.asyd.*		my_hdr From: Emmanuel Bouthenot <kolter+dev@openics.org>
+folder-hook ml\.gulliver.*	my_hdr From: Emmanuel Bouthenot <kolter+gull@openics.org>
+
+folder-hook .*\ml\..*		unmy_hdr Reply-To:
+folder-hook .*\ml\..*		unmy_hdr Bcc:
+
+macro generic \e<F1> "<enter-command>unmy_hdr *<enter><enter-command>my_hdr From: Emmanuel Bouthenot <kolter@openics.org><enter><enter-command>my_hdr User-Agent: $user_mua<enter><enter-command>my_hdr X-Operating-System: $user_os<enter><enter-command>my_hdr X-GnuPG-KeyID: $user_gpg_id<enter><enter-command>my_hdr X-GPG-Fingerprint: $user_gpg_fprint<enter><enter-command>set signature=~/.signatures/kolter_openics<enter>"
+macro generic \e<F2> "<enter-command>unmy_hdr *<enter><enter-command>my_hdr From: Emmanuel Bouthenot <emmanuel@bouthenot.name><enter><enter-command>my_hdr Reply-To: Emmanuel Bouthenot <emmanuel@bouthenot.name><enter><enter-command>my_hdr Bcc: Emmanuel Bouthenot <emmanuel@bouthenot.name><enter><enter-command>set signature=~/.signatures/manu_bouthenot<enter>"
+macro generic \e<F3> "<enter-command>unmy_hdr *<enter><enter-command>my_hdr From: Emmanuel Bouthenot <emmanuel.bouthenot@free.fr><enter><enter-command>set signature=~/.signatures/manu_free<enter>"

+ 25 - 0
.muttng/conf/keys

@@ -0,0 +1,25 @@
+# -*- muttngrc -*-
+#
+# Muttng configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Key bindings settings for Muttng.
+#
+
+bind index,pager "G" imap-fetch-mail
+
+bind index,pager "+" next-new
+bind index,pager "-" previous-new
+
+bind index,pager \cp sidebar-prev
+bind index,pager \cn sidebar-next
+bind index,pager \co sidebar-open
+
+bind index,pager <left>  sidebar-prev
+bind index,pager <right> sidebar-next
+bind index,pager *       sidebar-open
+bind index,pager <F11>   sidebar-scroll-up
+bind index,pager <F12>   sidebar-scroll-down

+ 30 - 0
.muttng/conf/macros

@@ -0,0 +1,30 @@
+# -*- muttngrc -*-
+#
+# Muttng configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Macros settings for Muttng.
+#
+
+macro generic \em	"<enter-command>source ~/.muttrc<enter>"	"Reloading muttng's configuration"
+
+macro index,pager <f1>	"<change-folder> =INBOX<enter>"			"Change folder for INBOX"
+macro index,pager <f2>	"<change-folder> =Sent<enter>"			"Change folder for Sent"
+macro index,pager <f3>	"<change-folder> =Draft<enter>"			"Change folder for Draft"
+macro index,pager <f4>	"<change-folder> =Spam<enter>"			"Change folder for Spam"
+macro index,pager <f5>	"<change-folder> =Trash<enter>"			"Change folder for Trash"
+
+macro index,pager B		"<enter-command>toggle sidebar_visible<enter>"	"Toggle sidebar visibility"
+
+macro index \cx "<tag-pattern>~N<enter><tag-prefix><toggle-new><tag-prefix><clear-flag>*" "Mark all new messages as read"
+
+# bogofilter macros
+#macro index,pager \cs ":unset wait_key\n|bogofilter -Ns\n:set wait_key\n:exec save-message\r=Spam\n" "*** set message as SPAM :-("
+#macro index,pager \ch ":unset wait_key\n|bogofilter -Sn\n:set wait_key\n:exec save-message\r=INBOX\n" "*** set message as HAM :-)"
+
+# spamassassin macros
+macro index,pager \ch "<enter-command>unset wait_key<enter><pipe-message>sa-learn --forget<enter><pipe-message>sa-learn --ham --no-sync<enter><enter-command>set wait_key<enter>"	"Set message as HAM"
+macro index,pager \cs "<enter-command>unset wait_key<enter><pipe-message>sa-learn --forget<enter><pipe-message>sa-learn --spam --no-sync<enter><enter-command>set wait_key<enter><save-message>=Spam<enter>" "Set message as SPAM"

+ 82 - 0
.muttng/conf/mailboxes

@@ -0,0 +1,82 @@
+# -*- muttngrc -*-
+#
+# Muttng configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Mailboxes settings for Muttng.
+#
+
+mailboxes =INBOX
+mailboxes =Draft
+mailboxes =Sent
+mailboxes =Spam
+mailboxes =Trash
+mailboxes =Queue
+
+mailboxes =sys.dak
+mailboxes =sys.reports
+mailboxes =sys.infos
+
+mailboxes =my.misc
+mailboxes =my.irc
+
+mailboxes =my.soft.debian.misc
+mailboxes =my.soft.debian.asso
+mailboxes =my.soft.debian.bts
+mailboxes =my.soft.debian.pkg.dudki
+mailboxes =my.soft.debian.pkg.ffproxy
+mailboxes =my.soft.debian.pkg.kio-apt
+mailboxes =my.soft.debian.pkg.kwin-style-knifty
+mailboxes =my.soft.debian.pkg.konqburn
+
+mailboxes =my.soft.weechat.ml.cvs
+mailboxes =my.soft.weechat.ml.devel
+mailboxes =my.soft.kde
+
+mailboxes =my.ml.asyd.sysadmin
+mailboxes =my.ml.asyd.shell
+mailboxes =my.ml.asyd.emacs
+
+mailboxes =my.ml.gulliver.gulliver
+
+mailboxes =my.ml.abul.asso
+mailboxes =my.ml.abul.tech
+mailboxes =my.ml.abul.party
+mailboxes =my.ml.abul.debutants
+mailboxes =my.ml.abul.blahblah
+mailboxes =my.ml.abul.annonces
+
+mailboxes =my.ml.lna.action
+
+mailboxes =my.ml.debian.announce
+mailboxes =my.ml.debian.mentors
+mailboxes =my.ml.debian.devel
+mailboxes =my.ml.debian.devel-changes
+mailboxes =my.ml.debian.devel-announce
+mailboxes =my.ml.debian.devel-french
+mailboxes =my.ml.debian.user-french
+mailboxes =my.ml.debian.security
+mailboxes =my.ml.debian.france.asso
+mailboxes =my.ml.debian.france.ml
+
+mailboxes =my.ml.hurd.debian
+mailboxes =my.ml.hurd.hurdfr
+#mailboxes =my.ml.hurd.l4
+
+mailboxes =computer.shop.ebay
+mailboxes =computer.paypal
+
+mailboxes =friends.tbs.tiacfooting
+mailboxes =friends.all.jm
+mailboxes =friends.all.ge
+
+mailboxes =my.pro.jobs
+
+mailboxes nntp://news.free.fr/proxad.dedibox.discussions.securite
+mailboxes nntp://news.free.fr/proxad.dedibox.annonces
+mailboxes nntp://news.free.fr/proxad.dedibox.maintenances
+mailboxes nntp://news.free.fr/proxad.dedibox.incidents
+

+ 20 - 0
.muttng/conf/my-headers

@@ -0,0 +1,20 @@
+# -*- muttngrc -*-
+#
+# Muttng configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Mail headers settings for Muttng.
+#
+
+# Ignore headers
+unmy_hdr *
+
+# defines
+my_hdr User-Agent: $user_mua
+my_hdr X-Operating-System: $user_os
+my_hdr X-GnuPG-KeyID: $user_gpg_id
+my_hdr X-GPG-Fingerprint: $user_gpg_fprint
+

+ 18 - 0
.muttng/conf/subscribes

@@ -0,0 +1,18 @@
+# -*- muttngrc -*-
+#
+# Muttng configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Subscribe settings for Muttng.
+#
+
+subscribe weechat-(dev|cvs)
+subscribe debian-.*@lists\.debian\.org
+subscribe .*@abul\.org
+subscribe linuxaction
+subscribe hurdfr@hurdfr\.org
+subscribe (shell|emacs|sysadmin)@asyd\.net
+subscribe .*@listes.gulliver.eu.org

+ 21 - 0
.muttng/etc/mailcap

@@ -0,0 +1,21 @@
+# -*- muttrc -*-
+#
+# Mutt configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Mailcap settings for Mutt.
+#
+
+#text/html; elinks -dump-charset utf8 -force-html -dump-width 132 -dump %s ; copiousoutput
+#text/html; iconv -f latin1 -t utf8 %s | w3m -dump -T text/html ; copiousoutput
+text/html; mailhtml2view %s ; copiousoutput
+
+audio/*; xmms %s
+image/*; display %s
+video/*; mplayer %s
+
+application/pdf; pdftotext -layout %s - | iconv -f latin1 -t utf8 ; copiousoutput;
+

+ 98 - 0
.muttngrc

@@ -0,0 +1,98 @@
+# -*- muttngrc -*-
+#
+# Muttng configuration file
+# 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+# Global configuration file for Muttng.
+#
+
+set realname        = "emmanuel Bouthenot"
+set from            = "kolter@openics.org"
+set signature       = "~/.signatures/kolter_openics"
+alternates          "kolter|emmanuel\.bouthenot|openics\.org|netconfig|bouthenot\.name"
+
+set locale          = "fr_FR.UTF-8"
+set charset         = "utf-8"
+
+set folder          = "imap://127.0.0.1"
+set mbox            = "imap://127.0.0.1/INBOX"
+set spoolfile       = "imap://127.0.0.1/INBOX"
+set record          = "imap://127.0.0.1/Sent"     # where to save sent mails
+set postponed       = "imap://127.0.0.1/Draft"    # where to save drafts
+
+source              ~/.muttngrc-imapauth          # get authentication params for imap
+
+set header_cache    = ~/.muttng/cache
+set tmpdir          = ~/.muttng/tmp
+
+set mail_check      = 60
+set timeout         = 240
+
+# nntp settings
+set nntp_host       = "news.free.fr"
+set nntp_cache_dir  = ~/.muttng/cache-nntp
+#set nntp_catchup    = yes
+set nntp_mail_check = 10
+#set nntp_reconnect  = yes
+#set nntp_group_index_format="%4C %M%N %n %5s  %-45.45f %d"
+
+# sidebar settings
+set sidebar_visible = yes
+set sidebar_width   = 46
+set sidebar_shorten_hierarchy = yes
+
+# user defined vars
+set user_mua          = "`muttng -v | head -1`"
+set user_os           = "Debian GNU/`uname -s` `cat /etc/debian_version` (`uname -r | cut -d'.' -f1-3`)"
+set user_gpg_id       = '414EC36E'
+set user_gpg_fprint   = '04DE 2F33 3CEF EF4F 46BF D6EA A475 EA19 414E C36E'
+
+#set mask="^[^.]"
+set editor               = "emacs -nw"
+set pager_stop           = yes                    # Do not move to the next message when at the end of a message
+set pager_context        = 2
+set pager_index_lines    = 15
+set edit_headers         = no
+set query_command        = "abook --mutt-query '%s'"
+set sleep_time           = 0
+
+auto_view text/html
+alternative_order text/enriched text/plain text
+
+set reverse_name    = yes                        # reply with address used by mail
+
+set recall          = no
+set mark_old        = no                         # Do not mark unread messages as old when leaving
+set delete          = ask-yes
+set print           = ask-yes
+set include         = yes
+
+set index_format     = "%3C %Z | %4c | %[%a %d %b %Y] | %[%H:%M] | %-27.27n | %s"
+set pager_format     = "| %C | %e | %Z | %c | %[%a %d %b %Y] | %[%H:%M] | %L (%a) | %s"
+set xterm_set_titles = yes
+set tilde            = yes
+#set narrow_tree     = yes
+
+set strict_threads   = yes
+set sort             = reverse-threads
+#set sort            = threads                     # Sort by threads
+#set sort_aux        = reverse-date                # Then sort by date
+
+mailboxes           "imap://127.0.0.1"
+source              ~/.muttng/conf/mailboxes
+
+source              ~/.muttng/conf/headers           # Configure header display.
+source              ~/.muttng/conf/my-headers        # Set personnal headers.
+source              ~/.muttng/conf/colors            # Define colours.
+source              ~/.muttng/conf/macros            # Define macros.
+source              ~/.muttng/conf/keys              # Define keybindings.
+source              ~/.muttng/conf/subscribes        # Define subscribing lists.
+source              ~/.muttng/conf/identities        # Define identities.
+
+set mailcap_path    = "~/.muttng/etc/mailcap:/etc/mailcap"
+
+set alias_file="~/.muttng/conf/aliases"
+source ~/.muttng/conf/aliases

+ 128 - 0
.screenrc

@@ -0,0 +1,128 @@
+# $Id: screenrc,v 1.15 2003/10/08 11:39:03 zal Exp $
+#
+# /etc/screenrc
+#
+#   This is the system wide screenrc.
+#
+#   You can use this file to change the default behavior of screen system wide
+#   or copy it to ~/.screenrc and use it as a starting point for your own
+#   settings.
+#
+#   Commands in this file are used to set options, bind screen functions to
+#   keys, redefine terminal capabilities, and to automatically establish one or
+#   more windows at the beginning of your screen session.
+#
+#   This is not a comprehensive list of options, look at the screen manual for
+#   details on everything that you can put in this file.
+#
+
+# ------------------------------------------------------------------------------
+# SCREEN SETTINGS
+# ------------------------------------------------------------------------------
+
+startup_message off
+#nethack on
+
+#defflow on # will force screen to process ^S/^Q
+deflogin on
+#autodetach off
+
+# turn visual bell on
+vbell on
+vbell_msg "   Wuff  ----  Wuff!!  "
+
+# define a bigger scrollback, default is 100 lines
+defscrollback 1024
+
+# turn utf8 on
+defutf8 on
+
+# ------------------------------------------------------------------------------
+# SCREEN KEYBINDINGS
+# ------------------------------------------------------------------------------
+
+# Remove some stupid / dangerous key bindings
+bind ^k
+#bind L
+bind ^\
+# Make them better
+bind \\ quit
+bind K kill
+bind I login on
+bind O login off
+bind } history
+
+# An example of a "screen scraper" which will launch urlview on the current
+# screen window
+#
+#bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"
+
+# ------------------------------------------------------------------------------
+# TERMINAL SETTINGS
+# ------------------------------------------------------------------------------
+
+# The vt100 description does not mention "dl". *sigh*
+termcapinfo vt100 dl=5\E[M
+
+# turn sending of screen messages to hardstatus off
+hardstatus off
+# Set the hardstatus prop on gui terms to set the titlebar/icon title
+termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
+# use this for the hard status string
+hardstatus string "%h%? users: %u%?"
+
+# An alternative hardstatus to display a bar at the bottom listing the
+# windownames and highlighting the current windowname in blue. (This is only
+# enabled if there is no hardstatus setting for your terminal)
+#
+#hardstatus lastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
+
+# set these terminals up to be 'optimal' instead of vt100
+termcapinfo xterm*|linux*|rxvt*|Eterm* OP
+
+# Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
+# (This fixes the "Aborted because of window size change" konsole symptoms found
+#  in bug #134198)
+termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
+
+# To get screen to add lines to xterm's scrollback buffer, uncomment the
+# following termcapinfo line which tells xterm to use the normal screen buffer
+# (which has scrollback), not the alternate screen buffer.
+#
+#termcapinfo xterm|xterms|xs|rxvt ti@:te@
+
+# ------------------------------------------------------------------------------
+# STARTUP SCREENS
+# ------------------------------------------------------------------------------
+
+# Example of automatically running some programs in windows on screen startup.
+#
+#   The following will open top in the first window, an ssh session to monkey
+#   in the next window, and then open mutt and tail in windows 8 and 9
+#   respectively.
+#
+# screen top
+# screen -t monkey ssh monkey
+# screen -t mail 8 mutt
+# screen -t daemon 9 tail -f /var/log/daemon.log
+
+#statusbar
+#hardstatus alwayslastline "%{= cw}screen > %-W %?%{!u}%n %t%{!u}%+W %=%{} [%02d/%02m/%Y][%0c:%s] on %H [%l]"
+
+#hardstatus alwayslastline " %{= kw}%?%-W %?%{!u}%n %t%{!u}%+W %=%{= bw} [%02d/%02m/%Y][%0c:%s] on %H"
+#hardstatus alwayslastline "%{+b kr}host: %{kw}%H %{kg} | %c | %{ky}%d.%m.%Y | %{kr}(load: %l)%-0=%{kw}"
+
+#scrollbar
+termcapinfo xterm ti@:te@
+
+#caption always "%{rw}%n%f %t %{wk} | %?%-Lw%?%{wb}[%n*%f %t]%?(%u)%?%{wk}%?%+Lw%? %{wk}"
+#caption splitonly
+#caption always "%{= cd}-=$LOGNAME@%H=- %-W %?%{.y}%n %t%{.d}%+W %=%{} %{.d}-=%0c=%l=-"
+#caption always "%{= cd}-=$LOGNAME@%H=- %-W %?%{!bu}%{.y}%n %t%{!bu}%{.w}%+W %=%{} %{.d}-=%0c=%l=-"
+#caption always "%{= .d}-=$LOGNAME@%H=- %-W %?%{!bu}%n %t%{!bu}%+W %=%{} %{.d}-=%0c=%l=-"
+
+caption always "%{= .d}$LOGNAME> %-W %?%{!bu}%n %t%{!bu}%+W %=%{} %=%{} [%02d/%02m/%Y][%0c:%s] on %H [%l]"
+
+bind ù caption splitonly
+bind µ caption always
+

+ 4 - 0
.signatures/kolter_free

@@ -0,0 +1,4 @@
+ mail : kolter@free.fr
+  gpg : 0x414EC36E
+  jid : kolter@amessage.de
+  irc : kolter@(freenode|oftc)

+ 5 - 0
.signatures/kolter_openics

@@ -0,0 +1,5 @@
+Emmanuel Bouthenot
+ mail : kolter@openics.org
+  gpg : 0x414EC36E
+  jid : kolter@im.openics.org
+  irc : kolter@(freenode|oftc)

+ 3 - 0
.signatures/manu_bouthenot

@@ -0,0 +1,3 @@
+Emmanuel Bouthenot
+ mail : emmanuel@bouthenot.name
+  tel : +33 (0) 6 17 29 01 91

+ 4 - 0
.signatures/manu_free

@@ -0,0 +1,4 @@
+Emmanuel Bouthenot
+ mail : emmanuel.bouthenot@free.fr
+  gpg : 0x414EC36E
+  tel : +33 (0) 6 17 29 01 91

+ 4 - 0
.signatures/manu_openics

@@ -0,0 +1,4 @@
+ mail : manu@openics.org
+  gpg : 0x414EC36E
+  jid : manu@im.openics.org
+

+ 1 - 0
.urlview

@@ -0,0 +1 @@
+COMMAND elinks "%s"

+ 9 - 0
.zlogout

@@ -0,0 +1,9 @@
+
+# because of using 'sudo zsh', root use my $HOME as its $HOME then
+# while using emacs, it backups its file on my ~/.emacs-backup
+# defined in my ~/.emacs and i don't want this then i choose
+# to delete this files on logout
+
+# NB : in newer versions of find there's the option '-delete'
+find $HOME/.emacs-backups -not -user $USERNAME -not -type d -exec rm -f {} \; >/dev/null 2>&1
+

+ 22 - 0
.zsh.d/config.d/alias.zsh

@@ -0,0 +1,22 @@
+
+# common aliases
+alias rm="rm -i"
+alias mv="mv -i"
+alias cp="cp -i"
+alias vlock="clear; vlock"
+alias lm="tail -n 60 -f /var/log/messages"
+alias df="df -h"
+alias emacs="emacs -nw"
+alias e="emacs -nw"
+alias rsu="sudo zsh"
+alias zconf="source ~/.zshrc"
+
+[ "$SUDO_USER" -a $UID = 0 ] && alias emacs="emacs -u $SUDO_USER -nw"
+[ "$SUDO_USER" -a $UID = 0 ] && alias e="emacs -u $SUDO_USER -nw"
+
+[ -x "$(whence ccze)" ] && alias lm="tail -n 60 -f /var/log/messages | ccze"
+[ -x "$(whence pydf)" ] && alias df="pydf -h"
+[ -x "$(whence most)" ] && export PAGER=most && alias more='most' && alias less='most'
+[ -x "$(whence colorgcc)" ] && export CC="colorgcc"
+
+

+ 104 - 0
.zsh.d/config.d/cliupd.zsh

@@ -0,0 +1,104 @@
+
+P_DARCS_SRV=http://darcs.openics.org
+P_DARCS_REP=kolter-dot-files
+P_LOG=darcs-$P_DARCS_REP.log
+P_TMPD=/tmp
+
+
+pdarcs_disp_log () {
+    echo
+    echo "                                              | ERRORS |"
+    echo "---8<---------------------------------------------------"
+    cat $P_LOG
+    echo "--------------------------------------------------->8---"
+    echo
+}
+
+
+pdarcs_md5_diff () {
+    # return 1 if different, 0 else
+
+    _MD5SUM=$(whence md5sum)
+    _MD5=$(whence md5)
+
+    if [ -x "$_MD5SUM" ]; then
+	MD5_1=$($_MD5SUM $1 |cut -d' ' -f1)
+	MD5_2=$($_MD5SUM $2 |cut -d' ' -f1)
+    elif [ -x "$_MD5" ]; then
+	MD5_1=$($_MD5 -q $1)
+	MD5_2=$($_MD5 -q $2)
+    else
+	MD5_1=1
+	MD5_2=2
+    fi
+    
+    if [ "$MD5_1" = "$MD5_2" ]; then
+	echo 0
+    else
+	echo 1
+    fi
+}
+
+pdarcs_clicnf_upd () {
+    PREV_CWD=$(pwd)
+    echo "**** updating files from '$P_DARCS_REP' ****"
+    echo
+
+    [ -n "$TMPDIR" ] && P_TMPD=$TMPDIR
+    cd $P_TMPD
+    echo "  -> using temp directory '$P_TMPD'"
+
+    echo -n "  -> deleting any previous darcs repository local copy '$P_DARCS_REP' ...  "
+    rm -rf $P_DARCS_REP >/dev/null 2>&1
+    [ $? = 0 ] && echo "[OK]" || echo "[FAILED]"
+    
+    echo -n "  -> getting darcs repository '$P_DARCS_SRV/$P_DARCS_REP/' ...  "
+    darcs get $P_DARCS_SRV/$P_DARCS_REP/ > $P_LOG 2>&1
+    [ $? != 0 ] && echo "[FAILED]" && pdarcs_disp_log && exit 1
+    echo "[OK]"
+    
+    echo -n "  -> changing directory '$P_DARCS_REP' ...  "
+    cd $P_DARCS_REP >/dev/null 2>&1
+    [ $? = 0 ] && echo "[OK]" || echo "[FAILED]"
+    
+    echo -n "  -> cleaning directory ...  "
+    rm -rf _darcs >/dev/null 2>&1
+    [ $? = 0 ] && echo "[OK]" || echo "[FAILED]"
+    
+    for d in $(find -not -name . -type d | xargs) ; do
+	dir=$HOME/$d
+	[ -d "$dir" ] && continue
+	echo -n "  -> creating directory '$dir' ...  "
+	mkdir -p $dir >/dev/null 2>&1
+	[ $? = 0 ] && echo "[OK]" || echo "[FAILED]"
+    done
+    
+    for f in $(find -not -name . -not -type d | xargs) ; do
+	file=$HOME/$f
+	upd=0
+	[ ! -e "$file" ] && upd=1
+	if [ $upd = 0 ]; then
+	    upd=$(pdarcs_md5_diff $f $file)
+	fi
+	if [ $upd = 1 ]; then
+	    echo -n "  -> updating file '$file' ...  "
+	    rm -f $file >/dev/null 2>&1
+	    cp -f $f $file >/dev/null 2>&1
+	    [ $? = 0 ] && echo "[OK]" || echo "[FAILED]"
+	fi
+    done
+    
+    echo -n "  -> changing directory for parent directory ...  "
+    cd .. >/dev/null 2>&1
+    [ $? = 0 ] && echo "[OK]" || echo "[FAILED]"
+
+    echo -n "  -> deleting darcs repository local copy '$P_DARCS_REP' ...  "
+    rm -rf $P_DARCS_REP $P_LOG >/dev/null 2>&1
+    [ $? = 0 ] && echo "[OK]" || echo "[FAILED]"
+    
+    cd $PREV_CWD >/dev/null 2>&1
+    echo
+    echo "**** end ****"
+}
+
+alias cliupd="pdarcs_clicnf_upd"

+ 14 - 0
.zsh.d/config.d/devel.zsh

@@ -0,0 +1,14 @@
+
+# devel stuff
+
+# WeeChat Stuff
+alias weecvs="cvs -z3 -d:ext:kolter@cvs.sv.gnu.org:/sources/weechat"
+compdef _cvs weecvs
+
+# kpkgmanager / kio-apt stuff
+alias kpmcvs="cvs -z3 -d:ext:kolterox@kpkgmanager.cvs.sourceforge.net:/cvsroot/kpkgmanager"
+compdef _cvs kpmcvs
+
+# Darcs Stuff
+alias dcs="darcs"
+compdef _darcs dcs

+ 15 - 0
.zsh.d/config.d/history.zsh

@@ -0,0 +1,15 @@
+
+# history options
+
+setopt EXTENDED_HISTORY		# add a timestamp and the duration of each command
+setopt SHARE_HISTORY	 	# _all_ zsh sessions share the same history files
+setopt HIST_IGNORE_ALL_DUPS	# ignores duplications
+
+HISTDIR=$DOTZSHDIR/history
+[ ! -d $HISTDIR ] && mkdir -p $HISTDIR
+HISTFILE=$HISTDIR/history
+
+HISTSIZE=1000000
+SAVEHIST=1000000
+
+export HISTFILE HISTSIZE SAVEHIST

+ 16 - 0
.zsh.d/config.d/options.zsh

@@ -0,0 +1,16 @@
+
+# zsh options
+
+export LISTPROMPT	# in order to scroll if completion list is too big
+
+setopt auto_cd		# a command like % /usr/local is equivalent to cd /usr/local
+setopt nohup            # don't send HUP signal when closing term session
+setopt extended_glob	# in order to use #, ~ and ^ for filename generation
+setopt always_to_end	# move to cursor to the end after completion
+setopt notify		# report the status of backgrounds jobs immediately
+setopt correct		# try to correct the spelling if possible
+setopt rmstarwait	# wait 10 seconds before querying for a rm which contains a *
+#setopt printexitvalue   # show the exit-value if > 0
+
+# Don't ecrase file with >, use >| (overwrite) or >> (append) instead 
+#set -C

+ 128 - 0
.zsh.d/config.d/prompt.zsh

@@ -0,0 +1,128 @@
+
+# prompt config
+
+export PR_OS_NAME=$(uname -s)
+export PR_OS_ARCH=$(uname -m)
+
+if [ -f /etc/debian_version ]; then
+    echo $PR_OS_NAME | grep -i linux >/dev/null 2>&1
+    if [ $? = 0 ]; then
+	PR_OS_NAME="Debian GNU/${PR_OS_NAME}"
+    else
+	PR_OS_NAME="Debian ${PR_OS_NAME}"
+    fi
+    debian_version=$(</etc/debian_version)
+    [ $debian_version = 'testing/unstable' ] && PR_OS_NAME="${PR_OS_NAME} sid" || PR_OS_NAME="${PR_OS_NAME} ${debian_version}"
+    
+    
+    if [ -f /etc/debian_chroot ]; then
+	chroot_name=(${(s:-:)$(</etc/debian_chroot)})
+	chroot_name=$chroot_name[0]
+	PR_OS_NAME="${PR_OS_NAME} [chroot: ${chroot_name}]"
+    fi
+	
+fi
+
+[ "$TERM" = "screen" -a -n "$WINDOW" ] && PR_OS_PTY="screen/$WINDOW" || PR_OS_PTY=$(print -P %l)
+export PR_OS_PTY
+
+function preexec {
+    
+    binonly=(emacs mplayer lftp most more less rsu)
+    
+    args=(${=1})
+    argsr=(${=2})
+    
+    if [[ $args[0] != $argsr[0] ]]; then
+	args[0]=$argsr[0]
+    fi
+    
+    [[ -n ${(M)binonly:#$args[0]} ]] && args=$args[0]
+    
+    if [ $UID = 0 ]; then
+	[ "$KONSOLE_DCOP_SESSION" ] && dcop $KONSOLE_DCOP_SESSION renameSession "*$args"
+	[ "$TERM" = "screen" ] && echo -ne "\033k*$args\033\\"
+    else
+	[ "$KONSOLE_DCOP_SESSION" ] && dcop $KONSOLE_DCOP_SESSION renameSession "$args"
+	[ "$TERM" = "screen" ] && echo -ne "\033k$args\033\\"
+    fi
+}
+
+function precmd {
+    # function called before displaying prompt
+    local TERMWIDTH
+    (( TERMWIDTH = ${COLUMNS} - 1 ))
+
+    # Truncate the path if it's too long.
+    local promptsize=${#${(%):---(%m)-(%n)-(%D{%H:%M})-($PR_OS_PTY)-($PR_OS_NAME)-($PR_OS_ARCH)---}}
+    PR_FILLBAR="\${(l.(($TERMWIDTH - $promptsize))..${PR_HBAR}.)}"
+    
+    if [ $UID = 0 ]; then
+	[ "$KONSOLE_DCOP_SESSION" ] && dcop $KONSOLE_DCOP_SESSION renameSession "*$(print -P %~)"
+	[ "$TERM" = "screen" ] && echo -ne "\033k*$(print -P %~)\033\\"
+    else
+        # if running konsole, setting current directory name in tab
+	[ "$KONSOLE_DCOP_SESSION" ] && dcop $KONSOLE_DCOP_SESSION renameSession "$(print -P %~)"
+        # if running screen, setting current directory name in caption/statusbar
+	[ "$TERM" = "screen" ] && echo -ne "\033k$(print -P %~)\033\\"
+    fi
+}
+
+myprompt() {
+
+    setopt prompt_subst
+
+    #enable colors
+    autoload colors zsh/terminfo
+    if [[ "$terminfo[colors]" -ge 8 ]]; then
+        colors
+    fi
+    for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
+	eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
+	eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
+        (( count = $count + 1 ))
+    done
+    PR_NO_COLOUR="%{$terminfo[sgr0]%}"
+    
+    typeset -A altchar
+    set -A altchar ${(s..)terminfo[acsc]}
+    PR_SET_CHARSET="%{$terminfo[enacs]%}"
+    PR_SHIFT_IN="%{$terminfo[smacs]%}"
+    PR_SHIFT_OUT="%{$terminfo[rmacs]%}"
+    PR_HBAR=${altchar[q]:--}
+    PR_ULCORNER=${altchar[l]:--}
+    PR_LLCORNER=${altchar[m]:--}
+    PR_LRCORNER=${altchar[j]:--}
+    PR_URCORNER=${altchar[k]:--}
+    
+    if [ "$TERM" = "dumb" ]; then
+	PROMPT="-(%n@%m)-(%(!.%d.%~))->"
+    else
+	PROMPT='\
+$PR_SET_CHARSET\
+$PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_CYAN$PR_HBAR$PR_SHIFT_OUT(\
+$PR_WHITE%m$PR_CYAN\
+$PR_SHIFT_IN$PR_CYAN)$PR_HBAR$PR_SHIFT_OUT(\
+%(!.$PR_RED%n.$PR_LIGHT_GREEN%n)\
+$PR_SHIFT_IN$PR_CYAN)$PR_HBAR$PR_SHIFT_OUT(\
+$PR_WHITE%D{%H:%M}$PR_CYAN\
+$PR_SHIFT_IN$PR_CYAN)$PR_HBAR$PR_SHIFT_OUT(\
+$PR_WHITE$PR_OS_PTY$PR_CYAN\
+$PR_SHIFT_IN$PR_CYAN)$PR_HBAR$PR_SHIFT_OUT(\
+$PR_WHITE$PR_OS_NAME$PR_CYAN\
+$PR_SHIFT_IN$PR_CYAN)$PR_HBAR$PR_SHIFT_OUT(\
+$PR_WHITE$PR_OS_ARCH$PR_CYAN\
+$PR_SHIFT_IN$PR_CYAN)$PR_HBAR$PR_SHIFT_OUT\
+$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_HBAR${(e)PR_FILLBAR}$PR_CYAN$PR_HBAR$PR_SHIFT_OUT\
+
+$PR_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_HBAR$PR_SHIFT_OUT\
+%1(j.{${PR_YELLOW}jobs$PR_CYAN:$PR_WHITE%j$PR_CYAN}$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT.)\
+%0(?..{${PR_RED}ret$PR_CYAN:$PR_WHITE%?$PR_CYAN}$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT)\
+($PR_WHITE%(!.%d.%~)$PR_CYAN)$PR_SHIFT_IN$PR_HBAR$PR_LRCORNER$PR_SHIFT_OUT\
+
+>$PR_NO_COLOUR'
+    fi
+    
+}
+
+myprompt

+ 3 - 0
.zsh.d/config.d/zle.zsh

@@ -0,0 +1,3 @@
+
+# zle config
+

+ 89 - 0
.zsh.d/config/dircolors

@@ -0,0 +1,89 @@
+# Below, there should be one TERM entry for each termtype that is colorizable
+TERM linux
+TERM console
+TERM con132x25
+TERM con132x30
+TERM con132x43
+TERM con132x60
+TERM con80x25
+TERM con80x28
+TERM con80x30
+TERM con80x43
+TERM con80x50
+TERM con80x60
+TERM xterm
+TERM vt100
+TERM xterm-xfree86
+
+# Below are the color init strings for the basic file types. A color init
+# string consists of one or more of the following numeric codes:
+# Attribute codes:
+# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
+# Text color codes:
+# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
+# Background color codes:
+# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
+NORMAL 00 # global default, although everything should be something.
+FILE 00 # normal file
+DIR 01;34 # directory
+LINK 01;36 # symbolic link
+FIFO 40;33 # pipe
+SOCK 01;33 # socket
+BLK 40;33;01 # block device driver
+CHR 40;33;01 # character device driver
+ORPHAN 40;31;01 # symlink to nonexistent file
+
+# This is for files with execute permission:
+EXEC 01;32
+
+# List any file extensions like '.gz' or '.tar' that you would like ls
+# to colorize below. Put the extension, a space, and the color init string.
+# (and any comments you want to add after a '#')
+
+
+*~     07;31 # old files (reverse red)
+*.bak  07;31
+*.old  07;31
+.mtxt  07;31
+.ndx   07;31
+.cmd   01;32  # executables (bright green)
+.exe   01;32
+.com   01;32
+.btm   01;32
+.bat   01;32
+.c     00;36  # source code (Cyan)
+.h     00;36
+.pl    00;36
+.php   00;36
+.pm    00;36
+.cgi   00;36
+.java  00;36
+.html  00;36
+.htm   00;36
+.o     00;33  # byte code (brown)
+.class 00;33
+.elc   00;33
+.tar   01;31  # archives or compressed (bright red)
+.tgz   01;31
+.tbz2  01;31
+.arj   01;31
+.taz   01;31
+.lzh   01;31
+.zip   01;31
+.z     01;31
+.Z     01;31
+.gz    01;31
+.bz2   01;31
+.rpm   01;31
+.deb   01;31
+.jpg   00;35  # image formats (bright magenta)
+.jpeg  01;35
+.JPG   01;35
+.gif   01;35
+.GIF   01;35
+.bmp   01;35
+.BMP   01;35
+.xbm   01;35
+.ppm   01;35
+.xpm   01;35
+.tif   01;35

+ 22 - 0
.zsh.d/functions.d/_a2utils

@@ -0,0 +1,22 @@
+#compdef a2ensite a2dissite a2enmod a2dismod
+
+case "$service" in
+    a2ensite)
+	sites=( /etc/apache2/sites-available/*(:t) )
+	_wanted sites expl sites compadd $sites
+	;;
+    a2dissite)
+	sites=( /etc/apache2/sites-enabled/*(:t) )
+	_wanted sites expl sites compadd $sites
+	;;
+    a2enmod)
+	mods=( /etc/apache2/mods-available/*.load(:r:t) )
+	_wanted mods expl mods compadd $mods
+	;;
+    a2dismod)
+	mods=( /etc/apache2/mods-enabled/*.load(:r:t) )
+	_wanted mods expl mods compadd $mods
+	;;
+esac
+
+return 0

+ 54 - 0
.zsh.d/functions.d/_aptitude

@@ -0,0 +1,54 @@
+#compdef aptitude
+
+local curcontext="$curcontext" state line cmds ret=1
+
+_arguments -C \
+  '(- 1 *)'{-h,--help}'[display help information]' \
+  '(- 1 *)--version[display version information]' \
+  '(-s --simulate)'{-s,--simulate}'[print actions without performing them]' \
+  '(-d --download-only)'{-d,--download-only}"[just download packages - don't install]" \
+  '(-P --prompt)'{-P,--prompt}'[always display a prompt]' \
+  '(-y --assume-yes)'{-y,--assume-yes}'[assume yes answer to questions]' \
+  '(-F --display-format)'{-F,--display-format}'[specify output format for search command]:format' \
+  '(-O --sort)'{-O,--sort}'[specify sort order]:sort order:()' \
+  '(-w --width)'{-w,--width}'[specify output width]:width' \
+  '-f[aggressivley try to fix dependencies of broken packages]' \
+  '(-V --show-versions)'{-V,--show-versions}'[show which versions of packages will be installed]' \
+  '(-D --show-deps)'{-D,--show-deps}'[show brief explanations of automatic installations and removals]' \
+  '-Z[show disk space changes for each package]' \
+  '(-v --verbose)'{-v,--verbose}'[causes some commands to display extra information]' \
+  '(--without-recommends)--with-recommends[install recommended packages when installing new packages]' \
+  '(--without-suggests)--with-suggests[install suggested packages when installing new packages]' \
+  '(--with-recommends)--without-recommends[ignore recommended packages when installing new packages]' \
+  '(--with-suggests)--without-suggests[ignore suggested packages when installing new packages]' \
+  '1: :->cmds' \
+  '*: :->args' && ret=0
+
+case $state in
+  cmds)
+    cmds=( ${${(M)${(f)"$(LC_ALL=C _call_program commands aptitude -h 2>/dev/null)"}:#* - *}/(#b) (*[^ ]) #- (*)/$match[1]:$match[2]:l})
+
+    _describe -t commands 'aptitude command' cmds && ret=0
+  ;;
+  args)
+    case $line[1] in
+      search)
+        _message -e patterns pattern
+      ;;
+      download|show)
+        _deb_packages avail && ret=0
+      ;;
+      remove|purge|hold)
+        _deb_packages installed && ret=0
+      ;;
+      install|markauto|unmarkauto)
+        _deb_packages uninstalled && ret=0
+      ;;
+      *)
+        (( ret )) && _message 'no more arguments'
+      ;;
+    esac
+  ;;
+esac
+
+return ret

+ 31 - 0
.zsh.d/functions.d/_invoke-rc.d

@@ -0,0 +1,31 @@
+#compdef invoke-rc.d
+
+local state ret=-1
+
+_arguments -C \
+    '(- 1 *)--help[display usage help]' \
+    '--quiet[quiet mode, no error messages displayed]' \
+    '--try-anyway[try to run script while non-fatal error is detected]' \
+    '--disclose-deny[return status code 101 instead of 0 if the script action is denied]' \
+    '--query[returns one of the status codes 100-106. Does not run the init script]' \
+    '--no-fallback[ignore any fallback action requests by the policy]' \
+    '--force[try to run the init script regardless of policy and errors]' \
+    '1:service:_services' \
+    '2:service action:->saction' \
+    '*::arguments _normal' \
+    && ret=0
+
+case $state in
+    saction)
+	case $words[CURRENT-1] in
+	    --*)
+		;;
+	    *)
+		actions=($(sed -ne "y/|/ /; s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" /etc/init.d/$words[CURRENT-1]))
+		 _wanted actions expl actions compadd $actions
+		;;
+	esac
+	;;
+esac
+
+return ret

+ 67 - 0
.zsh.d/functions.d/_weechat

@@ -0,0 +1,67 @@
+#compdef weechat-curses
+
+local state ret=-1
+
+_arguments -s -C \
+    '(-a --no-connect)'{-a,--no-connect}'[disable auto-connect to servers at startup]' \
+    '(-c --config)'{-c,--config}'[display config file options]' \
+    '(-d --dir)'{-d,--dir}'[set WeeChat home directory (default: ~/.weechat)]:dir:_dir_list' \
+    '(-f --key-functions)'{-f,--key-functions}'[display WeeChat internal functions for keys]' \
+    '(-h --help)'{-h,--help}'[display help and usage]' \
+    '(-i --irc-commands)'{-i,--irc-commands}'[display IRC commands]' \
+    '(-k --keys)'{-k,--keys}'[display WeeChat default keys]' \
+    '(-l --license)'{-l,--license}'[display WeeChat license]' \
+    '(-p --no-plugin)'{-p,--no-plugin}"[don't load any plugin at startup]" \
+    '(-v --version)'{-v,--version}'[display WeeChat version]' \
+    '(-w --weechat-commands)'{-w,--weechat-commands}'[display WeeChat commands]' \
+    '1:url:->weeurl' \
+    '*::arguments _normal' \
+    && ret=0
+
+
+if [ "$state" = 'weeurl' ]; then
+
+    urls=( irc:// ircs:// irc6:// irc6s:// )
+
+    nicks=( $(grep server_nick ~/.weechat/weechat.rc | tr -d '"' | cut -d ' ' -f3 | tr '\n' ' ') )
+    nicks+=('undef')
+    
+    pass=( $(grep server_password ~/.weechat/weechat.rc | tr -d '"' | cut -d ' ' -f3 | tr '\n' ' ') )
+    pass+=('undef')
+    
+    servers=( $(grep server_address ~/.weechat/weechat.rc | tr -d '"' | cut -d ' ' -f3 | tr '\n' ' ') )
+    servers+=('undef')
+    
+    set -a weeconf
+    
+    weeconf=()
+    for u in $urls ; do
+	for n in $nicks ; do
+	    for p in $pass; do
+		for s in $servers; do
+		    value=$u
+		    if [ "$n" != 'undef' ]; then
+			if [ "$p" != 'undef' ]; then
+			    value="${value}${n}:${p}"
+			else
+			    value="${value}${n}"
+			fi
+			if [ "$s" != 'undef' ]; then
+			    value="${value}@${s}"
+			fi
+		    else
+			if [ "$s" != 'undef' ]; then
+			    value="${value}${s}"
+			fi
+		    fi
+		    weeconf+=( $value )
+		done
+	    done
+	done
+    done
+    
+    _wanted weeconf expl weeconf compadd $weeconf
+    
+fi
+
+return ret

+ 0 - 0
.zsh.d/os.d/Debian.zsh


+ 34 - 0
.zsh.d/os.d/FreeBSD.zsh

@@ -0,0 +1,34 @@
+
+# using colortail if available
+[ -x "$(whence colortail)" ] && alias lm="colortail -n 60 -k /usr/local/share/examples/colortail/conf.messages -f /var/log/messages"
+
+# GNU ls(1) from FreeBSD ports is called gnuls(1).
+if [ -x "$(whence gnuls)" ]; then
+    if [ "$TERM" != "dumb" ]; then
+	if [ -r "$DOTZSHDIR/config/dircolors" ]; then
+	    eval $(dircolors -b $DOTZSHDIR/config/dircolors)
+	else
+	    eval $(dircolors -b)
+	fi
+	alias ls="gnuls -h --color=auto"
+	alias l="gnuls -lh --color=auto"
+    else
+	alias ls="gnuls -h"
+	alias l="gnuls -lh"
+    fi
+else
+    if [ "$TERM" != "dumb" ]; then
+	export LSCOLORS="exfxbxdxcxegedabagacad"
+	alias ls="ls -GFh"
+	alias l="ls -lGFh"
+    else
+	alias ls="ls -Fh"
+	alias l="ls -lFh"
+    fi
+fi
+
+# GNU tar from SunOS ports is called gtar 
+[ -x "$(whence gtar)" ] && alias tar="gtar"
+
+# GNU find is called gfind
+[ -x "$(whence gfind)" ] && alias find="gfind"

+ 17 - 0
.zsh.d/os.d/Linux.zsh

@@ -0,0 +1,17 @@
+
+# debian config
+[ -r /etc/debian_version ] && source $DOTZSHDIR/os.d/Debian.zsh
+
+if [ "$TERM" != "dumb" ]; then
+    if [ -r "$DOTZSHDIR/config/dircolors" ]; then
+	eval $(dircolors -b $DOTZSHDIR/config/dircolors)
+    else
+	eval $(dircolors -b)
+    fi
+    alias ls="ls -h --color=auto"
+    alias l="ls -lh --color=auto"
+else
+    alias ls="ls -h"
+    alias l="ls -lh"
+fi
+

+ 35 - 0
.zsh.d/os.d/OpenBSD.zsh

@@ -0,0 +1,35 @@
+
+# GNU ls(1) from OpenBSD ports is named gls(1)/gdircolors(1).
+if [ -x "$(whence gdircolors)" ]; then
+    if [ -r "$DOTZSHDIR/config/dircolors" ]; then
+	eval $(gdircolors -b $DOTZSHDIR/config/dircolors)
+    else
+	eval $(gdircolors -b)
+    fi
+    if [ "$TERM" != "dumb" ]; then
+	alias ls="gls -h --color=auto"
+	alias l="gls -lh --color=auto"
+    else
+	alias ls="gls -h"
+	alias l="gls -lh"
+    fi
+
+# colorls(1) is {Open,Net}BSD port name for FreeBSD ls(1)
+elif [ -x "$(whence colorls)" ]; then
+    if [ "$TERM" != "dumb" ]; then
+	export LSCOLORS="exfxbxdxcxegedabagacad"
+	alias ls="colorls -GFh"
+	alias l="colorls -lGFh"
+    else
+	alias ls="colorls -Fh"
+	alias l="colorls -lFh"
+    fi
+else
+    alias ls="ls -Fh"
+fi
+
+# GNU tar from SunOS ports is called gtar 
+[ -x "$(whence gtar)" ] && alias tar="gtar"
+
+# GNU find is called gfind
+[ -x "$(whence gfind)" ] && alias find="gfind"

+ 40 - 0
.zsh.d/os.d/SunOS.zsh

@@ -0,0 +1,40 @@
+
+PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin:/usr/openwin/bin
+
+MANPATH=/usr/man
+
+# pkgsrc
+if [ -d /usr/pkg ]; then
+    PATH=$PATH:/usr/pkg/bin:/usr/pkg/sbin
+    MANPATH=$MANPATH:/usr/pkg/man
+fi
+
+# blastwave
+if [ -d /opt/csw ]; then
+    PATH=$PATH:/opt/csw/bin:/opt/csw/sbin
+    MANPATH=$MANPATH:/opt/csw/man
+fi
+
+export PATH MANPATH
+
+# GNU ls(1) from SunOS ports is called gls(1)/gdircolors(1).
+if [ -x "$(whence gdircolors)" ]; then
+    if [ -r "$DOTZSHDIR/config/dircolors" ]; then
+	eval $(gdircolors -b $DOTZSHDIR/config/dircolors)
+    else
+	eval $(gdircolors -b)
+    fi
+    if [ "$TERM" != "dumb" ]; then
+	alias ls="gls -h --color=auto"
+	alias l="gls -lh --color=auto"
+    else
+	alias ls="gls -h"
+	alias l="gls -lh"
+    fi
+fi
+
+# GNU tar from SunOS ports is called gtar 
+[ -x "$(whence gtar)" ] && alias tar="gtar"
+
+# GNU find is called gfind
+[ -x "$(whence gfind)" ] && alias find="gfind"

+ 61 - 0
.zsh.d/zshrc

@@ -0,0 +1,61 @@
+#
+# Zsh configuration file
+# Since 2006,  kolter <kolter@openics.org>
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY
+#
+
+# editor
+export EDITOR="emacs"
+
+# email address
+export EMAIL="kolter@openics.org"
+
+# email address for anonymous ftp
+export EMAIL_ADDR=pwet@dev.null
+
+# redefine PATH
+export PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/games
+
+# define personal zsh config directory
+export DOTZSHDIR="$HOME/.zsh.d"
+
+# checking events on system (users login/logout, etc...)
+watch=(notme)
+LOGCHECK=5
+WATCHFMT="[%T] %n has %a %l from %M"
+
+# overide insecure stuff with compinit while using 'sudo zsh'
+# my functions (don't forget to modify fpath before call compinit !!)
+[ -z "$SUDO_USER" -a $UID != 0 ] && fpath=($DOTZSHDIR/functions.d $fpath)
+
+autoload -U zutil
+autoload -U compinit
+autoload -U complist
+compinit
+
+# override default umask
+umask 0022
+
+# sourcing resource files
+for f in $DOTZSHDIR/config.d/*.zsh; do
+    [ -r "$f" ] && source $f
+done
+
+# per OS resource file
+local os=$(uname)
+[ -r "$DOTZSHDIR/os.d/${os}.zsh" ] && source "$DOTZSHDIR/os.d/${os}.zsh"
+
+# using 'sudo zsh'
+if [ "$SUDO_USER" -a $UID = 0 ]; then
+    # define root history path
+    export HISTFILE="/root/.zsh_history"
+    
+    # ugly hack : reset some file perms to normal to avoid warnings
+    chmod 0644 ~/.zcompdump
+    chown $SUDO_USER:$SUDO_USER ~/.zcompdump
+fi
+
+# sourcing extra file
+[ -r "$DOTZSHDIR/extra.zsh" ] && source "$DOTZSHDIR/extra.zsh"

+ 6 - 0
.zshenv

@@ -0,0 +1,6 @@
+
+export LANG=fr_FR.UTF-8
+export TMPDIR=~/tmp
+
+[ -f /etc/debian_chroot ] && export DISPLAY=:0.0
+