X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/f965c3d7f14a4ce907c4c851d232cc9caf24204c..6e66e4c6fc350fe8cb85d4cc35d9ca567df56548:/lisp/mail/mh-e.el diff --git a/lisp/mail/mh-e.el b/lisp/mail/mh-e.el index 134d5d87cb..ef227bd66b 100644 --- a/lisp/mail/mh-e.el +++ b/lisp/mail/mh-e.el @@ -1,8 +1,8 @@ ;;; mh-e.el --- GNU Emacs interface to the MH mail system -;; Copyright (C) 1985,86,87,88,90,92,93,94,95 Free Software Foundation, Inc. +;; Copyright (C) 1985,86,87,88,90,92,93,94,95,97 Free Software Foundation, Inc. -;; Maintainer: Stephen Gildea +;; Maintainer: Stephen Gildea ;; Version: 5.0.2 ;; Keywords: mail ;; Bug-reports: include `M-x mh-version' output in any correspondence @@ -37,10 +37,10 @@ ;; Questions posting there for information on getting MH and mh-e. ;; mh-e is an Emacs interface to the MH mail system. -;; The mailing list mh-e@x.org is for discussion of mh-e and +;; There is a mailing list for discussion of mh-e and ;; announcements of new versions. Send a "subscribe" message to -;; mh-e-request@x.org to be added. Do not report bugs here; mail -;; them directly to the author (see top of mh-e.el source). +;; mh-e-request@gnu.org to be added. Do not report bugs here; mail +;; them directly to the maintainer (see top of mh-e.el source). ;; Include the output of M-x mh-version in any bug report. ;; mh-e works with GNU Emacs 18 or 19, and MH 6. @@ -60,7 +60,7 @@ ;; Modified by James Larus, BBN, July 1984 and UCB, 1984 & 1985. ;; Rewritten for GNU Emacs, James Larus 1985. larus@ginger.berkeley.edu ;; Modified by Stephen Gildea 1988. gildea@lcs.mit.edu -(defconst mh-e-RCS-id "$Id: mh-e.el,v 1.12 1996/01/20 02:47:33 erik Exp kwzh $") +(defconst mh-e-RCS-id "$Id: mh-e.el,v 1.20 1998/05/03 07:34:07 rms Exp kwzh $") ;;; Code: @@ -70,67 +70,108 @@ ;;; Hooks: -(defvar mh-folder-mode-hook nil - "Invoked in MH-Folder mode on a new folder.") +(defgroup mh nil + "Emacs interface to the MH mail system" + :group 'mail) -(defvar mh-inc-folder-hook nil - "Invoked by \\`\\[mh-inc-folder]' after incorporating mail into a folder.") +(defgroup mh-hook nil + "Hooks to mh-e mode" + :prefix "mh-" + :group 'mh) -(defvar mh-show-hook nil - "Invoked after \\`\\[mh-show]' shows a message.") -(defvar mh-show-mode-hook nil - "Invoked in MH-Show mode on each message.") +(defcustom mh-folder-mode-hook nil + "Invoked in MH-Folder mode on a new folder." + :type 'hook + :group 'mh-hook) -(defvar mh-delete-msg-hook nil - "Invoked after marking each message for deletion.") +(defcustom mh-inc-folder-hook nil + "Invoked by \\`\\[mh-inc-folder]' after incorporating mail into a folder." + :type 'hook + :group 'mh-hook) -(defvar mh-refile-msg-hook nil - "Invoked after marking each message for refiling.") +(defcustom mh-show-hook nil + "Invoked after \\`\\[mh-show]' shows a message." + :type 'hook + :group 'mh-hook) -(defvar mh-before-quit-hook nil - "Invoked by \\`\\[mh-quit]' before quitting mh-e. See also mh-quit-hook.") +(defcustom mh-show-mode-hook nil + "Invoked in MH-Show mode on each message." + :type 'hook + :group 'mh-hook) -(defvar mh-quit-hook nil - "Invoked after \\`\\[mh-quit]' quits mh-e. See also mh-before-quit-hook.") +(defcustom mh-delete-msg-hook nil + "Invoked after marking each message for deletion." + :type 'hook + :group 'mh-hook) + +(defcustom mh-refile-msg-hook nil + "Invoked after marking each message for refiling." + :type 'hook + :group 'mh-hook) + +(defcustom mh-before-quit-hook nil + "Invoked by \\`\\[mh-quit]' before quitting mh-e. See also mh-quit-hook." + :type 'hook + :group 'mh-hook) + +(defcustom mh-quit-hook nil + "Invoked after \\`\\[mh-quit]' quits mh-e. See also mh-before-quit-hook." + :type 'hook + :group 'mh-hook) ;;; Personal preferences: -(defvar mh-lpr-command-format "lpr -J '%s'" +(defcustom mh-lpr-command-format "lpr -J '%s'" "*Format for Unix command that prints a message. The string should be a Unix command line, with the string '%s' where the job's name (folder and message number) should appear. The formatted -message text is piped to this command when you type \\`\\[mh-print-msg]'.") +message text is piped to this command when you type \\`\\[mh-print-msg]'." + :type 'string + :group 'mh) -(defvar mh-scan-prog "scan" +(defcustom mh-scan-prog "scan" "*Program to run to generate one-line-per-message listing of a folder. Normally \"scan\" or a file name linked to scan. This file is searched for relative to the mh-progs directory unless it is an absolute pathname. -Automatically becomes buffer-local when set in any fashion.") +Automatically becomes buffer-local when set in any fashion." + :type 'string + :group 'mh) (make-variable-buffer-local 'mh-scan-prog) -(defvar mh-inc-prog "inc" +(defcustom mh-inc-prog "inc" "*Program to run to incorporate new mail into a folder. Normally \"inc\". This file is searched for relative to -the mh-progs directory unless it is an absolute pathname.") +the mh-progs directory unless it is an absolute pathname." + :type 'string + :group 'mh) -(defvar mh-print-background nil +(defcustom mh-print-background nil "*Print messages in the background if non-nil. WARNING: do not delete the messages until printing is finished; -otherwise, your output may be truncated.") +otherwise, your output may be truncated." + :type 'boolean + :group 'mh) -(defvar mh-recenter-summary-p nil - "*Recenter summary window when the show window is toggled off if non-nil.") +(defcustom mh-recenter-summary-p nil + "*Recenter summary window when the show window is toggled off if non-nil." + :type 'boolean + :group 'mh) -(defvar mh-do-not-confirm nil +(defcustom mh-do-not-confirm nil "*Non-nil means do not prompt for confirmation before some mh-e commands. -Affects non-recoverable commands such as mh-kill-folder and mh-undo-folder.") +Affects non-recoverable commands such as mh-kill-folder and mh-undo-folder." + :type 'boolean + :group 'mh) -(defvar mh-store-default-directory nil +(defcustom mh-store-default-directory nil "*Last directory used by \\[mh-store-msg]; default for next store. -A directory name string, or nil to use current directory.") +A directory name string, or nil to use current directory." + :type '(choice (const :tag "Current" nil) + directory) + :group 'mh) ;;; Parameterize mh-e to work with different scan formats. The defaults work ;;; with the standard MH scan listings, in which the first 4 characters on @@ -387,7 +428,6 @@ previous refile or write command." (message "Destination: %s" (cdr mh-last-destination)))) (mh-next-msg)) - (defun mh-quit () "Quit the current mh-e folder. Start by running mh-before-quit-hook. Restore the previous window @@ -519,7 +559,7 @@ provided, then prompt for the message sequence." (mh-find-progs) (set-buffer (get-buffer-create mh-temp-buffer)) (erase-buffer) - (insert " mh-e info:\n\nversion: " mh-e-version "\n" mh-e-time-stamp + (insert " mh-e info:\n\nversion: " mh-e-RCS-id "\nEmacs: " emacs-version " on " (symbol-name system-type) " ") (condition-case () (call-process "uname" nil t nil "-a") @@ -941,16 +981,16 @@ The value of mh-folder-mode-hook is called when a new folder is set up." (forward-char mh-cmd-note) (setq char (following-char)) (if (or (and remove-all-flags - (or (eql char (aref mh-note-deleted 0)) - (eql char (aref mh-note-refiled 0)))) - (eql char (aref mh-note-cur 0))) + (or (= char (aref mh-note-deleted 0)) + (= char (aref mh-note-refiled 0)))) + (= char (aref mh-note-cur 0))) (progn (delete-char 1) (insert " "))) (if remove-all-flags (progn (forward-char 1) - (if (eql (following-char) (aref mh-note-seq 0)) + (if (= (following-char) (aref mh-note-seq 0)) (progn (delete-char 1) (insert " "))))) @@ -1082,9 +1122,9 @@ The value of mh-folder-mode-hook is called when a new folder is set up." (while prev (if range-high (if (or (not (numberp prev)) - (not (eql (car msgs) (1- prev)))) + (not (equal (car msgs) (1- prev)))) (progn ;non-sequential, flush old range - (if (eql prev range-high) + (if (eq prev range-high) (setq ranges (cons range-high ranges)) (setq ranges (cons (format "%s-%s" prev range-high) ranges))) (setq range-high nil))))