]> code.delx.au - gnu-emacs/blobdiff - lisp/mh-e/mh-e.el
Doc fixes
[gnu-emacs] / lisp / mh-e / mh-e.el
index 4cef92681ca8dec3c51116cdbcb17c87b40e98df..2723fb5e684caa9ab1f1e5e714e1910078af8bcd 100644 (file)
@@ -1,12 +1,11 @@
 ;;; mh-e.el --- GNU Emacs interface to the MH mail system
 
-;; Copyright (C) 1985, 1986, 1987, 1988,
-;;  1990, 1992, 1993, 1994, 1995, 1997, 1999,
-;;  2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2012
+;;   Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 8.1
+;; Version: 8.3.1
 ;; Keywords: mail
 
 ;; This file is part of GNU Emacs.
@@ -28,7 +27,7 @@
 
 ;; MH-E is an Emacs interface to the MH mail system.
 
-;; MH-E is supported in GNU Emacs 21 and 22, as well as XEmacs 21
+;; MH-E is supported in GNU Emacs 21 and higher, as well as XEmacs 21
 ;; (except for versions 21.5.9-21.5.16). It is compatible with MH
 ;; versions 6.8.4 and higher, all versions of nmh, and GNU mailutils
 ;; 1.0 and higher. Gnus is also required; version 5.10 or higher is
 ;; Try to keep variables local to a single file. Provide accessors if
 ;; variables are shared. Use this section as a last resort.
 
-(defconst mh-version "8.1" "Version number of MH-E.")
+(defconst mh-version "8.3.1" "Version number of MH-E.")
 
 ;; Variants
 
@@ -283,8 +282,10 @@ Elements have the form (SEQUENCE . MESSAGES).")
 (defvar mh-show-buffer nil
   "Buffer that displays message for this folder.")
 
-(defvar mh-showing-mode nil
-  "If non-nil, show the message in a separate window.")
+(define-minor-mode mh-showing-mode
+  "Minor mode to show the message in a separate window."
+  ;; FIXME: maybe this should be moved to mh-show.el.
+  :lighter " Show")
 
 (defvar mh-view-ops nil
   "Stack of operations that change the folder view.
@@ -341,7 +342,7 @@ Name of the Previous sequence.")
   "Non-nil means that we have \"flists\".")
 
 (defvar mh-index-data-file ".mhe_index"
-  "MH-E specific file where index seach info is stored.")
+  "MH-E specific file where index search info is stored.")
 
 (defvar mh-letter-header-field-regexp "^\\([A-Za-z][A-Za-z0-9-]*\\):")
 
@@ -502,8 +503,7 @@ Adds double-quotes around entire string and quotes the characters
 The side effects are what is desired. Any output is assumed to be
 an error and is shown to the user. The output is not read or
 parsed by MH-E."
-  (save-excursion
-    (set-buffer (get-buffer-create mh-log-buffer))
+  (with-current-buffer (get-buffer-create mh-log-buffer)
     (let* ((initial-size (mh-truncate-log-buffer))
            (start (point))
            (args (mh-list-to-string args)))
@@ -522,8 +522,7 @@ parsed by MH-E."
   "In environment ENV, execute mh-command COMMAND with ARGS.
 ENV is nil or a string of space-separated \"var=value\" elements.
 Signals an error if process does not complete successfully."
-  (save-excursion
-    (set-buffer (get-buffer-create mh-temp-buffer))
+  (with-current-buffer (get-buffer-create mh-temp-buffer)
     (erase-buffer)
     (let ((process-environment process-environment))
       ;; XXX: We should purge the list that split-string returns of empty
@@ -543,8 +542,7 @@ otherwise the default filter `mh-process-daemon' is used. See
 `set-process-filter' for more details of FILTER.
 
 ARGS are passed to COMMAND as command line arguments."
-  (save-excursion
-    (set-buffer (get-buffer-create mh-log-buffer))
+  (with-current-buffer (get-buffer-create mh-log-buffer)
     (mh-truncate-log-buffer))
   (let* ((process-connection-type nil)
          (process (apply 'start-process
@@ -615,7 +613,8 @@ Output is expected to be shown to user, not parsed by MH-E."
   (mh-exchange-point-and-mark-preserving-active-mark))
 
 ;; Shush compiler.
-(defvar mark-active)                    ; XEmacs
+(mh-do-in-xemacs
+  (defvar mark-active))
 
 (defun mh-exchange-point-and-mark-preserving-active-mark ()
   "Put the mark where point is now, and point where the mark is now.
@@ -646,9 +645,8 @@ Set mark after inserted text."
     (insert (if (integerp status)
                 (format "%s: exit code %d\n" command status)
               (format "%s: %s\n" command status)))
-    (save-excursion
-      (let ((error-message (buffer-substring (point-min) (point-max))))
-        (set-buffer (get-buffer-create mh-log-buffer))
+    (let ((error-message (buffer-substring (point-min) (point-max))))
+      (with-current-buffer (get-buffer-create mh-log-buffer)
         (mh-truncate-log-buffer)
         (insert error-message)))
     (error "%s failed, check buffer %s for error message"
@@ -739,9 +737,8 @@ is described by the variable `mh-variants'."
 
 (defun mh-variant-info (dir)
   "Return MH variant found in DIR, or nil if none present."
-  (save-excursion
-    (let ((tmp-buffer (get-buffer-create mh-temp-buffer)))
-      (set-buffer tmp-buffer)
+  (let ((tmp-buffer (get-buffer-create mh-temp-buffer)))
+    (with-current-buffer tmp-buffer
       (cond
        ((mh-variant-mh-info dir))
        ((mh-variant-nmh-info dir))
@@ -934,7 +931,7 @@ finally GNU mailutils MH."
      (t
       (message "Unknown variant %s; use %s"
                variant
-               (mapconcat '(lambda (x) (format "%s" (car x)))
+               (mapconcat (lambda (x) (format "%s" (car x)))
                           (mh-variants) " or "))))))
 
 (defcustom-mh mh-variant 'autodetect
@@ -1180,7 +1177,7 @@ lowercase for mailing lists and uppercase for people."
   "*Non-nil means to expand aliases entered in the minibuffer.
 
 In other words, aliases entered in the minibuffer will be
-expanded to the full address in the message draft. By default,
+expanded to the full address in the message draft.  By default,
 this expansion is not performed."
   :type 'boolean
   :group 'mh-alias
@@ -2450,7 +2447,7 @@ of citations entirely, choose \"None\"."
     "Followup-To:"                      ; RFC 1036
     "For-Approval:"                     ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "For-Comment:"                      ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
-    "For-Handdling:"                    ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+    "For-Handling:"                     ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "Forwarded:"                        ; MH
     "From "                             ; sendmail
     "Generate-Delivery-Report:"         ; RFC 2156
@@ -2481,7 +2478,7 @@ of citations entirely, choose \"None\"."
     "Original-NNTP-"                    ; mail to news
     "Original-Path:"                    ; mail to news
     "Original-Received:"                ; mail to news
-    "Original-Recipt:"                  ; RFC 2298
+    "Original-Recipient:"               ; RFC 2298
     "Original-To:"                      ; mail to news
     "Original-X-"                       ; mail to news
     "Origination-Client:"               ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
@@ -2511,7 +2508,7 @@ of citations entirely, choose \"None\"."
     "Seal-Send-Time:"
     "See-Also:"                         ; H. Spencer: News Article Format and Transmission, June 1994
     "Sensitivity:"                      ; RFC 2156, 2421
-    "Speach-Act:"                       ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+    "Speech-Act:"                       ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "Status:"                           ; sendmail
     "Supersedes:"                       ; H. Spencer: News Article Format and Transmission, June 1994
     "Telefax:"                          ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
@@ -3242,6 +3239,14 @@ This can be done with this hook which is called when
   :group 'mh-search
   :package-version '(MH-E . "8.0"))
 
+(defcustom-mh mh-pack-folder-hook nil
+  "Hook run by \\<mh-folder-mode-map>\\[mh-pack-folder] after renumbering the messages.
+Hook functions can access the current folder name with `mh-current-folder'."
+  :type 'hook
+  :group 'mh-hooks
+  :group 'mh-folder
+  :package-version '(MH-E . "8.2"))
+
 (defcustom-mh mh-quit-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-quit] after quitting MH-E.
 
@@ -3718,5 +3723,4 @@ The background and foreground are used in the image."
 ;; sentence-end-double-space: nil
 ;; End:
 
-;; arch-tag: cce884de-bd37-4104-9963-e4439d5ed22b
 ;;; mh-e.el ends here