#!/bin/sh [ -n "$MUTTDISPLAY" ] && . "$MUTTDISPLAY" # Remove malformed data and some control characters when replying (or # composing a new message, but not when editing an existing message). [ "`head -c5 \"$1\"`" = "From:" ] && perl -i $HOME/bin/mkprintable \ "`codeset 2> /dev/null || locale charmap`" "$1" # If Mutt has been launched in Emacs's own window interface, then open # the message in the current Emacs window. Solution suggested by: # From: Matthieu Moy # Newsgroups: fr.comp.applications.emacs # Subject: Re: lancer Emacs avec un Mutt dedans en mode terminal # Date: Fri, 10 Feb 2006 14:26:13 +0100 # Message-ID: # We also need to redirect the output to /dev/null to avoid a blank # line being sent to the *Mutt* buffer (with the effect that Mutt's # status line is no longer visible without a refresh). if [ "$TERM" = eterm-color ] && gnuclient > /dev/null -batch -eval \ "(push (cons (find-file \"$1\") $$) mutteditor-pid-alist)"; then kill -STOP $$ # Let's hope this always works. See discussion in February 2006: # Newsgroups: fr.comp.os.unix # Subject: Ai-je resolu ce probleme "vieux comme le shell" ? # # The following code needs to be added to the .emacs file: # (setq mutteditor-pid-alist nil) # (defun mutteditor-kill () # (let ((a (assoc (current-buffer) mutteditor-pid-alist))) # (when a # (signal-process (cdr a) 'CONT) # (setq mutteditor-pid-alist (delq a mutteditor-pid-alist)) # ))) # (add-hook 'kill-buffer-hook 'mutteditor-kill) # # Alternative to "kill -STOP $$" (with SIGTERM instead of SIGCONT): # exec perl -e \ # 'use strict; use POSIX; $SIG{"TERM"} = sub { exit }; POSIX::pause' else # Fallback... exec emacs "$1" fi # $Id: mutteditor 31723 2009-09-10 21:45:51Z vinc17/xvii $