From xemacs-m  Wed Apr  2 13:47:16 1997
Received: from crystal.WonderWorks.COM (crystal.WonderWorks.com [192.203.206.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id NAA21868
	for <xemacs-beta@xemacs.org>; Wed, 2 Apr 1997 13:47:14 -0600 (CST)
Received: by crystal.WonderWorks.COM 
	id QQcjop16442; Wed, 2 Apr 1997 14:47:11 -0500 (EST)
Date: Wed, 2 Apr 1997 14:47:11 -0500 (EST)
Message-Id: <QQcjop16442.199704021947@crystal.WonderWorks.COM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Kyle Jones <kyle_jones@wonderworks.com>
To: xemacs-beta@xemacs.org
Subject: Re: mail mode nit
In-Reply-To: <199704021829.KAA18549@newman>
References: <E0wCVFF-0000sf-00@neal.ctd.comsat.com>
	<199704021829.KAA18549@newman>
X-Mailer: VM 6.23 under 19.15 XEmacs Lucid
X-Face: /cA45WHG7jWq>(O3&Z57Y<"WsX5ddc,4c#w0F*zrV#=M
        0@~@,s;b,aMtR5Sqs"+nU.z^CSFQ9t`z2>W,S,]:[+2^
        Nbf6v4g>!&,7R4Ot4Wg{&tm=WX7P["9%a)_da48-^tGy
        ,qz]Z,Zz\{E.,]'EO+F)@$KtF&V

William M. Perry writes:
 > Neal Becker writes:
 > >Wouldn't it be nice if TAB moved to the next field in mail mode?  Sort 
 > >of like traversing entries in a window system.
 > 
 >   you would of course have to deal with every time the user hit tab, seeing
 > if they were above or below mail-header-separator.  Other than that, I'd
 > say go for it.

"How hard could it be?", I thought.  It's nice to do micro project
in the midst of the usual "what is INN/innfeed/sendmail/ftpd/uucico
doing to me now??"

(defun mail-mode-smart-tab ()
  (interactive)
  (let ((text-start (save-excursion (mail-text) (point))))
    (if (>= (point) text-start)
	(tab-to-tab-stop)
      (if (re-search-forward "^[^ \t]" text-start t)
	  (if (looking-at "[^:]+: ?")
	      (goto-char (match-end 0))
	    (mail-text))
	(mail-text)))))

