aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wohler2008-08-10 23:12:40 +0000
committerBill Wohler2008-08-10 23:12:40 +0000
commitefa477613fc7a4ef997b8ff0d3722aef02baf662 (patch)
tree7a9a588a760ed36c86d990095ddd3ac08fe1bebe
parentd1c1d7c152e5f3bc76710aeb58351a03144eef39 (diff)
downloademacs-efa477613fc7a4ef997b8ff0d3722aef02baf662.tar.gz
emacs-efa477613fc7a4ef997b8ff0d3722aef02baf662.zip
(mh-variant-mh-info, mh-variant-nmh-info)
(mh-variant-set-variant, mh-variant-p, mh-profile-component) (mh-variant-set, mh-variant, mh-scan-format-file): Fix typo in docstring. (mh-variant-info,mh-variant-mu-mh-info) (mh-variant-p, mh-profile-component, mh-variant-set, mh-variant) (mh-scan-format-file): Rename variant mu-mh to gnu-mh and be explicit about GNU mailutils MH in docstrings (with thanks to Darel Henman) (closes SF #1768928).
-rw-r--r--lisp/mh-e/mh-e.el55
1 files changed, 34 insertions, 21 deletions
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index c022e1d354a..2f7d2c22c25 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -140,8 +140,8 @@
140 "/usr/contrib/mh/bin/" ; BSDI 140 "/usr/contrib/mh/bin/" ; BSDI
141 "/usr/pkg/bin/" ; NetBSD 141 "/usr/pkg/bin/" ; NetBSD
142 "/usr/local/bin/" 142 "/usr/local/bin/"
143 "/usr/local/bin/mu-mh/" ; GNU mailutils - default 143 "/usr/local/bin/mu-mh/" ; GNU mailutils MH - default
144 "/usr/bin/mu-mh/") ; GNU mailutils - packaged 144 "/usr/bin/mu-mh/") ; GNU mailutils MH - packaged
145 "List of directories to search for variants of the MH variant. 145 "List of directories to search for variants of the MH variant.
146The list `exec-path' is searched in addition to this list. 146The list `exec-path' is searched in addition to this list.
147There's no need for users to modify this list. Instead add extra 147There's no need for users to modify this list. Instead add extra
@@ -744,10 +744,10 @@ is described by the variable `mh-variants'."
744 (cond 744 (cond
745 ((mh-variant-mh-info dir)) 745 ((mh-variant-mh-info dir))
746 ((mh-variant-nmh-info dir)) 746 ((mh-variant-nmh-info dir))
747 ((mh-variant-mu-mh-info dir)))))) 747 ((mh-variant-gnu-mh-info dir))))))
748 748
749(defun mh-variant-mh-info (dir) 749(defun mh-variant-mh-info (dir)
750 "Return info for MH variant in DIR assuming a temporary buffer is setup." 750 "Return info for MH variant in DIR assuming a temporary buffer is set up."
751 ;; MH does not have the -version option. 751 ;; MH does not have the -version option.
752 ;; Its version number is included in the output of "-help" as: 752 ;; Its version number is included in the output of "-help" as:
753 ;; 753 ;;
@@ -777,9 +777,9 @@ is described by the variable `mh-variants'."
777 (mh-progs ,dir) 777 (mh-progs ,dir)
778 (flists nil))))))))) 778 (flists nil)))))))))
779 779
780(defun mh-variant-mu-mh-info (dir) 780(defun mh-variant-gnu-mh-info (dir)
781 "Return info for GNU mailutils variant in DIR. 781 "Return info for GNU mailutils MH variant in DIR.
782This assumes that a temporary buffer is setup." 782This assumes that a temporary buffer is set up."
783 ;; 'mhparam -version' output: 783 ;; 'mhparam -version' output:
784 ;; mhparam (GNU mailutils 0.3.2) 784 ;; mhparam (GNU mailutils 0.3.2)
785 (let ((mhparam (expand-file-name "mhparam" dir))) 785 (let ((mhparam (expand-file-name "mhparam" dir)))
@@ -792,7 +792,7 @@ This assumes that a temporary buffer is setup."
792 (let ((version (match-string 1)) 792 (let ((version (match-string 1))
793 (mh-progs dir)) 793 (mh-progs dir))
794 `(,version 794 `(,version
795 (variant mu-mh) 795 (variant gnu-mh)
796 (mh-lib-progs ,(mh-profile-component "libdir")) 796 (mh-lib-progs ,(mh-profile-component "libdir"))
797 (mh-lib ,(mh-profile-component "etcdir")) 797 (mh-lib ,(mh-profile-component "etcdir"))
798 (mh-progs ,dir) 798 (mh-progs ,dir)
@@ -800,7 +800,7 @@ This assumes that a temporary buffer is setup."
800 (expand-file-name "flists" dir))))))))) 800 (expand-file-name "flists" dir)))))))))
801 801
802(defun mh-variant-nmh-info (dir) 802(defun mh-variant-nmh-info (dir)
803 "Return info for nmh variant in DIR assuming a temporary buffer is setup." 803 "Return info for nmh variant in DIR assuming a temporary buffer is set up."
804 ;; `mhparam -version' outputs: 804 ;; `mhparam -version' outputs:
805 ;; mhparam -- nmh-1.1-RC1 [compiled on chaak at Fri Jun 20 11:03:28 PDT 2003] 805 ;; mhparam -- nmh-1.1-RC1 [compiled on chaak at Fri Jun 20 11:03:28 PDT 2003]
806 (let ((mhparam (expand-file-name "mhparam" dir))) 806 (let ((mhparam (expand-file-name "mhparam" dir)))
@@ -824,7 +824,7 @@ This assumes that a temporary buffer is setup."
824 (and (file-regular-p file) (file-executable-p file))) 824 (and (file-regular-p file) (file-executable-p file)))
825 825
826(defun mh-variant-set-variant (variant) 826(defun mh-variant-set-variant (variant)
827 "Setup the system variables for the MH variant named VARIANT. 827 "Set up the system variables for the MH variant named VARIANT.
828If VARIANT is a string, use that key in the alist returned by the 828If VARIANT is a string, use that key in the alist returned by the
829function `mh-variants'. 829function `mh-variants'.
830If VARIANT is a symbol, select the first entry that matches that 830If VARIANT is a symbol, select the first entry that matches that
@@ -864,7 +864,7 @@ variant."
864 864
865(defun mh-variant-p (&rest variants) 865(defun mh-variant-p (&rest variants)
866 "Return t if variant is any of VARIANTS. 866 "Return t if variant is any of VARIANTS.
867Currently known variants are 'MH, 'nmh, and 'mu-mh." 867Currently known variants are 'MH, 'nmh, and 'gnu-mh."
868 (let ((variant-in-use 868 (let ((variant-in-use
869 (cadr (assoc 'variant (assoc mh-variant-in-use (mh-variants)))))) 869 (cadr (assoc 'variant (assoc mh-variant-in-use (mh-variants))))))
870 (not (null (member variant-in-use variants))))) 870 (not (null (member variant-in-use variants)))))
@@ -872,8 +872,9 @@ Currently known variants are 'MH, 'nmh, and 'mu-mh."
872(defun mh-profile-component (component) 872(defun mh-profile-component (component)
873 "Return COMPONENT value from mhparam, or nil if unset." 873 "Return COMPONENT value from mhparam, or nil if unset."
874 (save-excursion 874 (save-excursion
875 ;; MH and nmh use -components, Mailutils uses -component. Since MH 875 ;; MH and nmh use -components, GNU mailutils MH uses -component.
876 ;; and nmh work with an unambiguous prefix, the `s' is dropped here. 876 ;; Since MH and nmh work with an unambiguous prefix, the `s' is
877 ;; dropped here.
877 (mh-exec-cmd-quiet nil "mhparam" "-component" component) 878 (mh-exec-cmd-quiet nil "mhparam" "-component" component)
878 (mh-profile-component-value component))) 879 (mh-profile-component-value component)))
879 880
@@ -895,12 +896,23 @@ Returns nil if the component is not in the buffer."
895Sets `mh-progs', `mh-lib', `mh-lib-progs' and 896Sets `mh-progs', `mh-lib', `mh-lib-progs' and
896`mh-flists-present-flag'. 897`mh-flists-present-flag'.
897If the VARIANT is \"autodetect\", then first try nmh, then MH and 898If the VARIANT is \"autodetect\", then first try nmh, then MH and
898finally GNU mailutils." 899finally GNU mailutils MH."
899 (interactive 900 (interactive
900 (list (completing-read 901 (list (completing-read
901 "MH variant: " 902 "MH variant: "
902 (mapcar (lambda (x) (list (car x))) (mh-variants)) 903 (mapcar (lambda (x) (list (car x))) (mh-variants))
903 nil t))) 904 nil t)))
905
906 ;; TODO Remove mu-mh backwards compatibility in 9.0.
907 (when (and (stringp variant)
908 (string-match "^mu-mh" variant))
909 (message
910 (format "%s\n%s; %s" "The variant name mh-mh has been renamed to gnu-mh"
911 "and will be removed in MH-E 9.0"
912 "try M-x customize-option mh-variant"))
913 (sit-for 5)
914 (setq variant (concat "gnu-mh" (substring variant (match-end 0)))))
915
904 (let ((valid-list (mapcar (lambda (x) (car x)) (mh-variants)))) 916 (let ((valid-list (mapcar (lambda (x) (car x)) (mh-variants))))
905 (cond 917 (cond
906 ((eq variant 'none)) 918 ((eq variant 'none))
@@ -910,7 +922,7 @@ finally GNU mailutils."
910 (message "%s installed as MH variant" mh-variant-in-use)) 922 (message "%s installed as MH variant" mh-variant-in-use))
911 ((mh-variant-set-variant 'mh) 923 ((mh-variant-set-variant 'mh)
912 (message "%s installed as MH variant" mh-variant-in-use)) 924 (message "%s installed as MH variant" mh-variant-in-use))
913 ((mh-variant-set-variant 'mu-mh) 925 ((mh-variant-set-variant 'gnu-mh)
914 (message "%s installed as MH variant" mh-variant-in-use)) 926 (message "%s installed as MH variant" mh-variant-in-use))
915 (t 927 (t
916 (message "No MH variant found on the system")))) 928 (message "No MH variant found on the system"))))
@@ -919,7 +931,8 @@ finally GNU mailutils."
919 (message "Warning: %s variant not found. Autodetecting..." variant) 931 (message "Warning: %s variant not found. Autodetecting..." variant)
920 (mh-variant-set 'autodetect))) 932 (mh-variant-set 'autodetect)))
921 (t 933 (t
922 (message "Unknown variant; use %s" 934 (message "Unknown variant %s; use %s"
935 variant
923 (mapconcat '(lambda (x) (format "%s" (car x))) 936 (mapconcat '(lambda (x) (format "%s" (car x)))
924 (mh-variants) " or ")))))) 937 (mh-variants) " or "))))))
925 938
@@ -928,14 +941,14 @@ finally GNU mailutils."
928 941
929The default setting of this option is \"Auto-detect\" which means 942The default setting of this option is \"Auto-detect\" which means
930that MH-E will automatically choose the first of nmh, MH, or GNU 943that MH-E will automatically choose the first of nmh, MH, or GNU
931mailutils that it finds in the directories listed in 944mailutils MH that it finds in the directories listed in
932`mh-path' (which you can customize), `mh-sys-path', and 945`mh-path' (which you can customize), `mh-sys-path', and
933`exec-path'. If MH-E can't find MH at all, you may have to 946`exec-path'. If MH-E can't find MH at all, you may have to
934customize `mh-path' and add the directory in which the command 947customize `mh-path' and add the directory in which the command
935\"mhparam\" is located. If, on the other hand, you have both nmh 948\"mhparam\" is located. If, on the other hand, you have both nmh
936and mailutils installed (for example) and `mh-variant-in-use' was 949and GNU mailutils MH installed (for example) and
937initialized to nmh but you want to use mailutils, then you can 950`mh-variant-in-use' was initialized to nmh but you want to use
938set this option to \"mailutils\". 951GNU mailutils MH, then you can set this option to \"gnu-mh\".
939 952
940When this variable is changed, MH-E resets `mh-progs', `mh-lib', 953When this variable is changed, MH-E resets `mh-progs', `mh-lib',
941`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use' 954`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
@@ -1996,7 +2009,7 @@ set SYMBOL to VALUE."
1996The default setting for this option is \"Use MH-E scan Format\". This 2009The default setting for this option is \"Use MH-E scan Format\". This
1997means that the format string will be taken from the either 2010means that the format string will be taken from the either
1998`mh-scan-format-mh' or `mh-scan-format-nmh' depending on whether MH or 2011`mh-scan-format-mh' or `mh-scan-format-nmh' depending on whether MH or
1999nmh (or GNU mailutils) is in use. This setting also enables you to 2012nmh (or GNU mailutils MH) is in use. This setting also enables you to
2000turn on the `mh-adaptive-cmd-note-flag' option. 2013turn on the `mh-adaptive-cmd-note-flag' option.
2001 2014
2002You can also set this option to \"Use Default scan Format\" to get the 2015You can also set this option to \"Use Default scan Format\" to get the