[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-mailutils] [PATCH] Support for mailutils-mh
From: |
Sergey Poznyakoff |
Subject: |
[bug-mailutils] [PATCH] Support for mailutils-mh |
Date: |
Wed, 13 Aug 2003 10:17:07 +0300 |
Hello,
The attached patch adds the support for Mailutils MH to the development
version of MH-E. The support for GNU long options is added only when
it is absolutely necessary, namely in mh-pick.el.
There is a point that I haven't solved yet: the file mh-e.el on lines
1713-1717 relies on the error output from scan. Mailutils implementation
of MH has i18n support, so if a user sets LC_ALL variable to an another
language, the error strings will differ and this part of code will
malfunction. Forcefully resetting LC_ALL to C doesn't seem to be a
feasible solution, instead I plan to add to the MH utilities the new
option `--emacs', which will output additional locale-independent
diagnostics.
The modifications has been tested against the CVS version of Mailutils.
I'd appreciate your comments, propositions and opinions.
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 06:43:53 -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 \\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 06:43:57 -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))
+ (r
+ (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 06:43:57 -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 06:43:57 -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,9 @@ 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."
+ (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
- Re: [bug-mailutils] mailutils-mh: Compatibility with new MH-E, (continued)
- Re: [bug-mailutils] mailutils-mh: Compatibility with new MH-E, Sergey Poznyakoff, 2003/08/12
- [bug-mailutils] Re: [PATCH] Support for mailutils-mh, Sergey Poznyakoff, 2003/08/13
- [bug-mailutils] Re: [PATCH] Support for mailutils-mh, Peter S Galbraith, 2003/08/13
- [bug-mailutils] Re: [PATCH] Support for mailutils-mh, Sergey Poznyakoff, 2003/08/13
- [bug-mailutils] Re: [PATCH] Support for mailutils-mh, Peter S Galbraith, 2003/08/13
- [bug-mailutils] Re: [PATCH] Support for mailutils-mh, Sergey Poznyakoff, 2003/08/13
- [bug-mailutils] Re: [PATCH] Support for mailutils-mh, Peter S Galbraith, 2003/08/13
- Re: [bug-mailutils] mailutils-mh: Compatibility with new MH-E, Sergey Poznyakoff, 2003/08/12
Re: [bug-mailutils] mailutils-mh: Compatibility with new MH-E, Sergey Poznyakoff, 2003/08/11