;;; mh-funcs.el --- MH-E functions not everyone will use right away
-;; Copyright (C) 1993, 1995,
-;; 2001, 2002, 2003, 2004, 2005, 2006, 2007 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>
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
(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
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)
(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)
(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))
storing the content of these messages."
(interactive (list (let ((udir (or mh-store-default-directory
default-directory)))
- (read-file-name "Store message in directory: "
+ (read-directory-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))))
See `mh-store-msg' for a description of DIRECTORY."
(interactive (list (let ((udir (or mh-store-default-directory
default-directory)))
- (read-file-name "Store buffer in directory: "
+ (read-directory-name "Store buffer in directory: "
udir udir nil))))
(let ((store-directory (expand-file-name directory))
(sh-start (save-excursion
(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
(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)))))
;; sentence-end-double-space: nil
;; End:
-;; arch-tag: 1936c4f1-4843-438e-bc4b-a63bb75a7762
;;; mh-funcs.el ends here