Refill some long/short copyright headers.
[bpt/emacs.git] / lisp / mh-e / mh-funcs.el
index d9f68f7..ad50841 100644 (file)
@@ -1,7 +1,6 @@
 ;;; mh-funcs.el --- MH-E functions not everyone will use right away
 
-;; Copyright (C) 1993, 1995,
-;;  2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995, 2001-2011  Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -144,8 +143,7 @@ Display the results only if something went wrong."
   (interactive)
   (let ((temp-buffer mh-folders-buffer))
     (with-output-to-temp-buffer temp-buffer
-      (save-excursion
-        (set-buffer temp-buffer)
+      (with-current-buffer temp-buffer
         (erase-buffer)
         (message "Listing folders...")
         (mh-exec-cmd-output "folders" t (if mh-recursive-folders-flag
@@ -168,7 +166,10 @@ in interactive use.
 
 This command will ask if you want to process refiles or deletes
 first and then either run \\[mh-execute-commands] for you or undo
-the pending refiles and deletes."
+the pending refiles and deletes.
+
+The hook `mh-pack-folder-hook' is run after the folder is packed;
+see its documentation for variables it can use."
   (interactive (list (if current-prefix-arg
                          (mh-read-range "Scan" mh-current-folder t nil t
                                         mh-interpret-number-as-range-flag)
@@ -180,6 +181,7 @@ the pending refiles and deletes."
       (mh-index-update-maps mh-current-folder))
     (cond (threaded-flag (mh-toggle-threads))
           (mh-index-data (mh-index-insert-folder-headers))))
+  (run-hooks 'mh-pack-folder-hook)
   (message "Packing folder...done"))
 
 (defun mh-pack-folder-1 (range)
@@ -241,8 +243,7 @@ to the command."
    (list (read-string "Shell command on message: ") current-prefix-arg))
   (let ((msg-file-to-pipe (mh-msg-filename (mh-get-msg-num t)))
         (message-directory default-directory))
-    (save-excursion
-      (set-buffer (get-buffer-create mh-temp-buffer))
+    (with-current-buffer (get-buffer-create mh-temp-buffer)
       (erase-buffer)
       (insert-file-contents msg-file-to-pipe)
       (goto-char (point-min))
@@ -288,8 +289,7 @@ storing the content of these messages."
                        (read-file-name "Store message in directory: "
                                        udir udir nil))))
   (let ((msg-file-to-store (mh-msg-filename (mh-get-msg-num t))))
-    (save-excursion
-      (set-buffer (get-buffer-create mh-temp-buffer))
+    (with-current-buffer (get-buffer-create mh-temp-buffer)
       (erase-buffer)
       (insert-file-contents msg-file-to-store)
       (mh-store-buffer directory))))
@@ -327,8 +327,7 @@ See `mh-store-msg' for a description of DIRECTORY."
               (setq uudecode-filename
                     (buffer-substring (point)
                                       (progn (end-of-line) (point)))))))
-    (save-excursion
-      (set-buffer (get-buffer-create mh-log-buffer))
+    (with-current-buffer (get-buffer-create mh-log-buffer)
       (setq log-begin (mh-truncate-log-buffer))
       (if (not (file-directory-p store-directory))
           (progn
@@ -345,8 +344,7 @@ See `mh-store-msg' for a description of DIRECTORY."
       (if (equal (call-process-region sh-start (point-max) command
                                       nil mh-log-buffer t)
                  0)
-          (save-excursion
-            (set-buffer mh-log-buffer)
+          (with-current-buffer mh-log-buffer
             (insert "\n(mh-store finished)\n"))
         (error "Error occurred during execution of %s" command)))))
 
@@ -372,5 +370,4 @@ See `mh-store-msg' for a description of DIRECTORY."
 ;; sentence-end-double-space: nil
 ;; End:
 
-;; arch-tag: 1936c4f1-4843-438e-bc4b-a63bb75a7762
 ;;; mh-funcs.el ends here