[PATCH] Fix M-x tmda-pending for new script output

Bob Rogers <[email protected]> Sun, 13 Jan 2008 21:36:31 -0500
Newsgroups gmane.mail.spam.tmda.devel
Message-ID <[email protected]>
--nQLVOR2nCs
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

   After upgrading from 1.1.4 to 1.1.12, I noticed that the tmda-pending
script now drops the ".msg" from the message file name in "terse"
output.  Unfortunately, this breaks M-x tmda-pending, which relies on
the ".msg" suffix to recognize the name.  The attached patch to tmda.el
fixes the problem, in a way that allows both styles of output to be
parsed.

   I also have an improved version of tmda-pending-refresh-buffer that
does a prettier job of reformatting the script output, and uses the
Emacs truncate-lines feature to preserve long subjects while still
getting the effect of one line per message.  If you'd also like to
consider this version (which also has the ".msg" fix), I'd be happy to
send that along as well.

   TIA,

					-- Bob Rogers
					   http://rgrjr.dyndns.org/


--nQLVOR2nCs
Content-Type: text/plain
Content-Description: 
Content-Disposition: inline;
	filename="pending-msg-fix-1.patch"
Content-Transfer-Encoding: 7bit

* tmda/contrib/tmda.el:
   + (tmda-pending-refresh-buffer):  Make the ".msg" at the end of the
     message file name optional, as tmda-pending now drops these.
   + (tmda-pending-msg):  Ditto.

Diffs between last version checked in and current workfile(s):

Index: tmda/contrib/tmda.el
===================================================================
--- tmda/contrib/tmda.el	(revision 2194)
+++ tmda/contrib/tmda.el	(working copy)
@@ -617,10 +617,9 @@
     (let ((winwidth (1- (window-width))))
       (goto-char (point-min))
       (while (not (eobp))
-        (cond ((looking-at ".*[0-9.]+\\.msg[\t ]")
+        (cond ((looking-at "^$\\|^-\\*-"))      ; do nothing
+	      ((looking-at "[\t ]*[0-9.msg]+[\t ]")
                (insert "[ ] "))
-              ((looking-at "^$"))      ; do nothing
-              ((looking-at "^-\\*- ")) ; again, do nothing
               (t
                (insert "    ")))
         (when tmda-pending-truncate-lines
@@ -639,7 +638,7 @@
   (save-excursion
     (beginning-of-line)
     (when (looking-at "\\[.\\] ")
-      (progn (re-search-forward "\\([0-9.]+msg\\)[\t ]")
+      (progn (re-search-forward "\\([0-9.msg]+\\)[\t ]")
 	     (match-string 1)))))
 
 (defmacro tmda-pending-command (&rest forms)

End of diffs.

--nQLVOR2nCs
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline