;; MH-E is an Emacs interface to the MH mail system.
-;; MH-E is supported in GNU Emacs 20 and 21, with MH 6.8.4 and nmh 1.0.4.
+;; MH-E is supported in GNU Emacs 21 and 22 as well as XEmacs 21
+;; (except for versions 21.5.9-21.5.16), with MH 6.8.4 on, nmh 1.0.4
+;; on, and GNU mailutils 0.4 on.
;; Mailing Lists:
;; mh-e-users@lists.sourceforge.net
(eval-when-compile (require 'mh-acros))
(mh-require-cl)
-(require 'mh-utils)
-(require 'mh-init)
-(require 'mh-inc)
-(require 'mh-seq)
-(require 'gnus-util)
-(require 'easymenu)
-;; Shush the byte-compiler
-(eval-when-compile
- (defvar font-lock-auto-fontify)
- (defvar font-lock-defaults))
+(require 'easymenu)
+(require 'gnus-util)
+(require 'mh-buffers)
+(require 'mh-seq)
+(require 'mh-utils)
(defconst mh-version "7.85+cvs" "Version number of MH-E.")
(error "No previous refile or write"))
(cond ((eq (car mh-last-destination) 'refile)
(mh-refile-msg range (cdr mh-last-destination))
- (message "%s" (format "Destination folder: %s"
- (cdr mh-last-destination))))
+ (message "Destination folder: %s" (cdr mh-last-destination)))
(t
(mh-iterate-on-range msg range
(apply 'mh-write-msg-to-file msg (cdr mh-last-destination)))
many unread messages to skip."
(interactive "p")
(unless (> count 0)
- (error "The function mh-previous-unread-msg expects positive argument"))
+ (error "The function `mh-previous-unread-msg' expects positive argument"))
(setq count (1- count))
(let ((unread-sequence (cdr (assoc mh-unseen-seq mh-seq-list)))
(cur-msg (mh-get-msg-num nil)))
(when (consp part-index) (setq part-index (car part-index)))
(mh-folder-mime-action part-index #'mh-mime-save-part nil))
-(defvar mh-thread-scan-line-map-stack)
-
(defun mh-reset-threads-and-narrowing ()
"Reset all variables pertaining to threads and narrowing.
Also removes all content from the folder buffer."
mh-interpret-number-as-range-flag)
nil)))
(setq mh-next-direction 'forward)
- (let ((threaded-flag (memq 'unthread mh-view-ops)))
+ (let ((threaded-flag (memq 'unthread mh-view-ops))
+ (msg-num (mh-get-msg-num nil)))
(mh-scan-folder mh-current-folder (or range "all") dont-exec-pending)
+ ;; If there isn't a cur sequence, mh-scan-folder goes to the first message.
+ ;; Try to stay where we were.
+ (if (null (car (mh-seq-to-msgs 'cur)))
+ (mh-goto-msg msg-num t t))
(cond (threaded-flag (mh-toggle-threads))
(mh-index-data (mh-index-insert-folder-headers)))))
(if (not (mh-outstanding-commands-p))
(mh-set-folder-modified-p nil)))
-
(defun mh-folder-line-matches-show-buffer-p ()
"Return t if the message under point in folder-mode is in the show buffer.
Return nil in any other circumstance (no message under point, no
(setq mh-previous-window-config config)))
nil)
-
(defun mh-update-sequences ()
"Flush MH-E's state out to MH.
(beginning-of-line)
(setq message (mh-get-msg-num t)))
(if (looking-at mh-scan-refiled-msg-regexp)
- (error "Message %d is refiled. Undo refile before deleting" message))
+ (error "Message %d is refiled; undo refile before deleting" message))
(if (looking-at mh-scan-deleted-msg-regexp)
nil
(mh-set-folder-modified-p t)
(beginning-of-line)
(setq message (mh-get-msg-num t)))
(cond ((looking-at mh-scan-deleted-msg-regexp)
- (error "Message %d is deleted. Undo delete before moving" message))
+ (error "Message %d is deleted; undo delete before moving" message))
((looking-at mh-scan-refiled-msg-regexp)
(if (y-or-n-p
- (format "Message %d already refiled. Copy to %s as well? "
+ (format "Message %d already refiled; copy to %s as well? "
message folder))
(mh-exec-cmd "refile" (mh-get-msg-num t) "-link"
"-src" mh-current-folder
many unread messages to skip."
(interactive "p")
(unless (> count 0)
- (error "The function mh-next-unread-msg expects positive argument"))
+ (error "The function `mh-next-unread-msg' expects positive argument"))
(setq count (1- count))
(let ((unread-sequence (reverse (cdr (assoc mh-unseen-seq mh-seq-list))))
(cur-msg (mh-get-msg-num nil)))
["List Folders" mh-list-folders t]
["Visit a Folder..." mh-visit-folder t]
["View New Messages" mh-index-new-messages t]
- ["Search a Folder..." mh-search-folder t]
- ["Indexed Search..." mh-index-search t]
+ ["Search..." mh-search t]
"--"
["Quit MH-E" mh-quit t]))
onward while the latter is used in previous versions and XEmacs."
(if (boundp 'write-file-functions)
''write-file-functions ;Emacs 21.4
- ''local-write-file-hooks)) ;<Emacs 21.4, XEmacs
-
-;; Avoid compiler warnings in non-bleeding edge versions of Emacs.
-(eval-when-compile
- (defvar tool-bar-mode)
- (defvar tool-bar-map)
- (defvar desktop-save-buffer)) ;Emacs 21.4
+ ''local-write-file-hooks)) ;XEmacs
;; Register mh-folder-mode as supporting which-function-mode...
(load "which-func" t t)
(not (member 'mh-folder-mode which-func-modes)))
(push 'mh-folder-mode which-func-modes))
+;; Shush compiler.
+(eval-when-compile
+ (defvar desktop-save-buffer)
+ (defvar font-lock-auto-fontify))
+
(defvar mh-folder-buttons-init-flag nil)
;; Autoload cookie needed by desktop.el
'mh-folder-view-stack () ; Stack of previous views of the
; folder.
'mh-index-data nil ; If the folder was created by a call
- ; to mh-index-search this contains info
+ ; to mh-search, this contains info
; about the search results.
- 'mh-index-previous-search nil ; Previous folder and search-regexp
+ 'mh-index-previous-search nil ; folder, indexer, search-regexp
'mh-index-msg-checksum-map nil ; msg -> checksum map
'mh-index-checksum-origin-map nil ; checksum -> ( orig-folder, orig-msg )
'mh-index-sequence-search-flag nil ; folder resulted from sequence search
(defun mh-colors-available-p ()
"Check if colors are available in the Emacs being used."
(or mh-xemacs-flag
- (let ((color-cells
- (or (ignore-errors (mh-funcall-if-exists display-color-cells))
- (ignore-errors (mh-funcall-if-exists
- x-display-color-cells)))))
+ (let ((color-cells (display-color-cells)))
(and (numberp color-cells) (>= color-cells 8)))))
(defun mh-colors-in-use-p ()
comes after that."
(if (eq mh-scan-format-file t)
(max (1+ width) 2)
- (error "%s %s" "Can't call mh-msg-num-width-to-column"
- "when mh-scan-format-file is not t")))
+ (error "%s %s" "Can't call `mh-msg-num-width-to-column' when"
+ "`mh-scan-format-file' is not set to \"Use MH-E scan Format\"")))
(defun mh-set-cmd-note (column)
"Set `mh-cmd-note' to COLUMN.
(mh-remove-sequence-notation msg nil t))
(clrhash mh-sequence-notation-history)))
-
(defun mh-goto-cur-msg (&optional minimal-changes-flag)
"Position the cursor at the current message.
When optional argument MINIMAL-CHANGES-FLAG is non-nil, the
"S" mh-sort-folder
"c" mh-catchup
"f" mh-alt-visit-folder
- "i" mh-index-search
"k" mh-kill-folder
"l" mh-list-folders
"n" mh-index-new-messages
"p" mh-pack-folder
"q" mh-index-sequenced-messages
"r" mh-rescan-folder
- "s" mh-search-folder
+ "s" mh-search
"u" mh-undo-folder
"v" mh-visit-folder)