bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-mailutils] Re: [PATCH] Support for mailutils-mh


From: Sergey Poznyakoff
Subject: [bug-mailutils] Re: [PATCH] Support for mailutils-mh
Date: Wed, 13 Aug 2003 14:58:15 +0300

Peter S Galbraith <address@hidden> wrote:

> There's no need for you to figure out how to do it, although your work
> is welcome!

Thanks. I've just discovered a typo in the patch. In mh-e.el:1140 I
wrote 'r' instead of 't'. The fixed patch is attached.

Regards,
Sergey

Index: mh-comp.el
===================================================================
RCS file: /cvsroot/mh-e/src/mh-comp.el,v
retrieving revision 1.248
diff -p -u -r1.248 mh-comp.el
--- mh-comp.el  9 Aug 2003 03:23:27 -0000       1.248
+++ mh-comp.el  13 Aug 2003 11:51:39 -0000
@@ -1143,9 +1143,13 @@ The versions of MH-E, Emacs, and MH are 
       (let ((info-buffer-exists-p (get-buffer mh-info-buffer)))
         (mh-version)
         (set-buffer mh-info-buffer)
-        (if mh-nmh-flag
-            (search-forward-regexp "^nmh-\\(\\S +\\)")
-          (search-forward-regexp "^MH \\(\\S +\\)" nil t))
+        (cond
+         (mh-nmh-flag
+          (search-forward-regexp "^nmh-\\(\\S +\\)"))
+         (mh-mailutils-mh-flag
+          (search-forward-regexp "^(\\(GNU Mailutils \\S +\\))"))
+         (t
+          (search-forward-regexp "^MH \\(\\S +\\)" nil t)))
         (let ((x-mailer-mh (buffer-substring (match-beginning 1)
                                              (match-end 1))))
           (setq mh-x-mailer-string
Index: mh-e.el
===================================================================
RCS file: /cvsroot/mh-e/src/mh-e.el,v
retrieving revision 1.350
diff -p -u -r1.350 mh-e.el
--- mh-e.el     7 Aug 2003 21:53:31 -0000       1.350
+++ mh-e.el     13 Aug 2003 11:51:40 -0000
@@ -1123,12 +1123,22 @@ compiled then macro expansion happens at
   ;; MH version.
   (let ((help-start (point)))
     (condition-case err-data
-        (mh-exec-cmd-output "inc" nil (if mh-nmh-flag "-version" "-help"))
+        (mh-exec-cmd-output "inc" nil (cond
+                                       (mh-nmh-flag
+                                        "-version")
+                                       (mh-mailutils-mh-flag
+                                        "--version")
+                                       (t
+                                        "-help")))
       (file-error (insert (mapconcat 'concat (cdr err-data) ": ") "\n")))
     (goto-char help-start)
-    (if mh-nmh-flag
-        (search-forward "inc -- " nil t)
-      (search-forward "version: " nil t))
+    (cond
+     (mh-nmh-flag
+      (search-forward "inc -- " nil t))
+     (mh-mailutils-mh-flag
+      (search-forward "inc " nil t))
+     (t
+      (search-forward "version: " nil t)))
     (delete-region help-start (point)))
   (goto-char (point-max))
   (insert " mh-progs:\t" mh-progs "\n"
@@ -1702,7 +1712,9 @@ If UPDATE, append the scan lines, otherw
       (goto-char scan-start)
       (cond ((looking-at "scan: no messages in")
              (keep-lines mh-scan-valid-regexp)) ; Flush random scan lines
-            ((looking-at "scan: bad message list ")
+            ((looking-at (if mh-mailutils-mh-flag
+                             "scan: message set .* does not exist"
+                           "scan: bad message list "))
              (keep-lines mh-scan-valid-regexp))
             ((looking-at "scan: "))     ; Keep error messages
             (t
Index: mh-pick.el
===================================================================
RCS file: /cvsroot/mh-e/src/mh-pick.el,v
retrieving revision 1.34
diff -p -u -r1.34 mh-pick.el
--- mh-pick.el  31 Jul 2003 05:25:49 -0000      1.34
+++ mh-pick.el  13 Aug 2003 11:51:40 -0000
@@ -250,6 +250,9 @@ COMPONENT is the component to search."
            "-rbrace"))
         (t (error "Unknown operator '%s' seen" (car expr)))))
 
+(defconst mh-pick-single-dash
+  '(cc date from subject to))
+
 (defun mh-pick-regexp-builder (pattern-list)
   "Generate pick search expression from PATTERN-LIST."
   (let ((result ()))
@@ -257,9 +260,20 @@ COMPONENT is the component to search."
       (when (cdr pattern)
         (setq result `(,@result "-and" "-lbrace"
                        ,@(mh-pick-construct-regexp
-                          (cdr pattern) (if (car pattern)
-                                            (format "-%s" (car pattern))
-                                          "-search"))
+                          (if (and mh-mailutils-mh-flag (car pattern))
+                              (format "--pattern=%s" (cdr pattern))
+                            (cdr pattern))
+                          
+                          (if (car pattern)
+                              (cond
+                               (mh-mailutils-mh-flag
+                                (format "--component=%s" (car pattern)))
+                               ((member (car pattern)
+                                        mh-pick-single-dash)
+                                (format "-%s" (car pattern)))
+                               (t
+                                (format "--%s" (car pattern))))
+                            "-search"))
                        "-rbrace"))))
     (cdr result)))
 
Index: mh-utils.el
===================================================================
RCS file: /cvsroot/mh-e/src/mh-utils.el,v
retrieving revision 1.311
diff -p -u -r1.311 mh-utils.el
--- mh-utils.el 10 Aug 2003 01:57:01 -0000      1.311
+++ mh-utils.el 13 Aug 2003 11:51:42 -0000
@@ -83,6 +83,9 @@ This directory contains, among other thi
 (defvar mh-nmh-flag nil
   "Non-nil means nmh is installed on this system instead of MH.")
 
+(defvar mh-mailutils-mh-flag nil
+  "Non-nil means mailutils-mh is installed on this system instead of MH.")
+
 (defvar mh-flists-present-flag nil
   "Non-nil means that we have `flists'.")
 
@@ -94,6 +97,9 @@ This directory contains, among other thi
 (put 'mh-lib-progs 'risky-local-variable t)
 ;;;###autoload
 (put 'mh-nmh-flag 'risky-local-variable t)
+;;;###autoload
+(put 'mh-mailutils-mh-flag 'risky-local-variable t)
+
 
 ;;; CL Replacements
 (defun mh-search-from-end (char string)
@@ -1883,7 +1889,10 @@ arguments, after these variable have bee
 (defun mh-find-progs ()
   "Find the directories for the installed MH/nmh binaries and config files.
 Set the `mh-progs' and `mh-lib', and `mh-lib-progs' variables to the
-directory names and set `mh-nmh-flag' if we detect nmh instead of MH."
+directory names and set `mh-nmh-flag' if we detect nmh instead of MH,
+or `mh-mailutils-mh-flag' if we detect Mailutils instead of MH."
+  (unless (and mh-progs mh-lib mh-lib-progs)
+    (setq mh-mailutils-mh-flag (load "mailutils-mh" t)))
   (unless (and mh-progs mh-lib mh-lib-progs)
     (let ((path (or (mh-path-search exec-path "mhparam")
                     (mh-path-search '("/usr/local/nmh/bin" ; nmh default
cvs server: Diffing mail

reply via email to

[Prev in Thread] Current Thread [Next in Thread]