summaryrefslogtreecommitdiff
path: root/lisp/mh-e
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mh-e')
-rw-r--r--lisp/mh-e/mh-acros.el17
-rw-r--r--lisp/mh-e/mh-alias.el3
-rw-r--r--lisp/mh-e/mh-comp.el127
-rw-r--r--lisp/mh-e/mh-compat.el6
-rw-r--r--lisp/mh-e/mh-e.el7
-rw-r--r--lisp/mh-e/mh-folder.el2
-rw-r--r--lisp/mh-e/mh-funcs.el2
-rw-r--r--lisp/mh-e/mh-identity.el27
-rw-r--r--lisp/mh-e/mh-junk.el6
-rw-r--r--lisp/mh-e/mh-letter.el13
-rw-r--r--lisp/mh-e/mh-mime.el2
-rw-r--r--lisp/mh-e/mh-show.el6
-rw-r--r--lisp/mh-e/mh-speed.el6
-rw-r--r--lisp/mh-e/mh-thread.el25
-rw-r--r--lisp/mh-e/mh-utils.el1
15 files changed, 164 insertions, 86 deletions
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index ce5c7a65929..893564419bc 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -61,8 +61,8 @@ particular, the expansion of (setf (gethash ...) ...) used
functions in \"cl\" at run time. This macro recognizes that and
loads \"cl\" appropriately."
(if (eq (car (macroexpand '(setf (gethash foo bar) baz))) 'cl-puthash)
- `(require 'cl)
- `(eval-when-compile (require 'cl))))
+ '(require 'cl)
+ '(eval-when-compile (require 'cl))))
;;;###mh-autoload
(defmacro mh-do-in-gnu-emacs (&rest body)
@@ -90,9 +90,10 @@ loads \"cl\" appropriately."
"Create function NAME.
If FUNCTION exists, then NAME becomes an alias for FUNCTION.
Otherwise, create function NAME with ARG-LIST and BODY."
- `(if (fboundp ',function)
- (defalias ',name ',function)
- (defun ,name ,arg-list ,@body)))
+ `(defalias ',name
+ (if (fboundp ',function)
+ ',function
+ (lambda ,arg-list ,@body))))
(put 'defun-mh 'lisp-indent-function 'defun)
(put 'defun-mh 'doc-string-elt 4)
@@ -127,11 +128,11 @@ XEmacs and versions of GNU Emacs before 21.1 require
In GNU Emacs if CHECK-TRANSIENT-MARK-MODE-FLAG is non-nil then
check if variable `transient-mark-mode' is active."
(cond ((featurep 'xemacs) ;XEmacs
- `(and (boundp 'zmacs-regions) zmacs-regions (region-active-p)))
+ '(and (boundp 'zmacs-regions) zmacs-regions (region-active-p)))
((not check-transient-mark-mode-flag) ;GNU Emacs
- `(and (boundp 'mark-active) mark-active))
+ '(and (boundp 'mark-active) mark-active))
(t ;GNU Emacs
- `(and (boundp 'transient-mark-mode) transient-mark-mode
+ '(and (boundp 'transient-mark-mode) transient-mark-mode
(boundp 'mark-active) mark-active))))
;; Shush compiler.
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index 7b44db60378..3f895f4ecdf 100644
--- a/lisp/mh-e/mh-alias.el
+++ b/lisp/mh-e/mh-alias.el
@@ -78,7 +78,8 @@ If ARG is non-nil, set timestamp with the current time."
(function
(lambda (file)
(when (and file (file-exists-p file))
- (setq stamp (nth 5 (file-attributes file)))
+ (setq stamp (file-attribute-modification-time
+ (file-attributes file)))
(or (> (car stamp) (car mh-alias-tstamp))
(and (= (car stamp) (car mh-alias-tstamp))
(> (cadr stamp) (cadr mh-alias-tstamp)))))))
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index c51052dc3f4..706e64dd77a 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -77,6 +77,14 @@ Default is \"components\".
If not an absolute file name, the file is searched for first in the
user's MH directory, then in the system MH lib directory.")
+(defvar mh-dist-formfile "distcomps"
+ "Name of file to be used as a skeleton for redistributing messages.
+
+Default is \"distcomps\".
+
+If not an absolute file name, the file is searched for first in the
+user's MH directory, then in the system MH lib directory.")
+
(defvar mh-repl-formfile "replcomps"
"Name of file to be used as a skeleton for replying to messages.
@@ -305,24 +313,26 @@ message and scan line."
(file-name buffer-file-name)
(config mh-previous-window-config)
(coding-system-for-write
- (if (and (local-variable-p 'buffer-file-coding-system
- (current-buffer)) ;XEmacs needs two args
- ;; We're not sure why, but buffer-file-coding-system
- ;; tends to get set to undecided-unix.
- (not (memq buffer-file-coding-system
- '(undecided undecided-unix undecided-dos))))
- buffer-file-coding-system
- (or (and (boundp 'sendmail-coding-system) sendmail-coding-system)
- (and (default-boundp 'buffer-file-coding-system)
- (default-value 'buffer-file-coding-system))
- 'iso-latin-1))))
+ (if (fboundp 'select-message-coding-system)
+ (select-message-coding-system) ; Emacs has this since at least 21.1
+ (if (and (local-variable-p 'buffer-file-coding-system
+ (current-buffer)) ;XEmacs needs two args
+ ;; We're not sure why, but buffer-file-coding-system
+ ;; tends to get set to undecided-unix.
+ (not (memq buffer-file-coding-system
+ '(undecided undecided-unix undecided-dos))))
+ buffer-file-coding-system
+ (or (and (boundp 'sendmail-coding-system) sendmail-coding-system)
+ (and (default-boundp 'buffer-file-coding-system)
+ (default-value 'buffer-file-coding-system))
+ 'iso-latin-1)))))
;; Older versions of spost do not support -msgid and -mime.
(unless mh-send-uses-spost-flag
;; Adding a Message-ID field looks good, makes it easier to search for
;; message in your +outbox, and best of all doesn't break threading for
;; the recipient if you reply to a message in your +outbox.
(setq mh-send-args (concat "-msgid " mh-send-args))
- ;; The default BCC encapsulation will make a MIME message unreadable.
+ ;; The default Bcc encapsulation will make a MIME message unreadable.
;; With nmh use the -mime arg to prevent this.
(if (and (mh-variant-p 'nmh)
(mh-goto-header-field "Bcc:")
@@ -411,7 +421,7 @@ See also `mh-send'."
(interactive (list (mh-get-msg-num t)))
(let* ((from-folder mh-current-folder)
(config (current-window-configuration))
- (components-file (mh-bare-components))
+ (components-file (mh-bare-components mh-comp-formfile))
(draft
(cond ((and mh-draft-folder (equal from-folder mh-draft-folder))
(pop-to-buffer (find-file-noselect (mh-msg-filename message))
@@ -647,15 +657,16 @@ Original message has headers FROM and SUBJECT."
(format mh-forward-subject-format from subject))
;;;###mh-autoload
-(defun mh-redistribute (to cc &optional message)
+(defun mh-redistribute (to cc identity &optional message)
"Redistribute a message.
This command is similar in function to forwarding mail, but it
does not allow you to edit the message, nor does it add your name
to the \"From\" header field. It appears to the recipient as if
the message had come from the original sender. When you run this
-command, you are prompted for the TO and CC recipients. The
-default MESSAGE is the current message.
+command, you are prompted for the TO and CC recipients. You are
+also prompted for the sending IDENTITY to use. The default
+MESSAGE is the current message.
Also investigate the command \\[mh-edit-again] for another way to
redistribute messages.
@@ -666,6 +677,9 @@ The hook `mh-annotate-msg-hook' is run after annotating the
message and scan line."
(interactive (list (mh-read-address "Redist-To: ")
(mh-read-address "Redist-Cc: ")
+ (if mh-identity-list
+ (mh-select-identity mh-identity-default)
+ nil)
(mh-get-msg-num t)))
(or message
(setq message (mh-get-msg-num t)))
@@ -675,14 +689,51 @@ message and scan line."
(if mh-redist-full-contents-flag
(mh-msg-filename message)
nil)
- nil)))
- (mh-goto-header-end 0)
- (insert "Resent-To: " to "\n")
- (if (not (equal cc "")) (insert "Resent-cc: " cc "\n"))
- (mh-clean-msg-header
- (point-min)
- "^Message-Id:\\|^Received:\\|^Return-Path:\\|^Sender:\\|^Date:\\|^From:"
- nil)
+ nil))
+ (from (mh-identity-field identity "From"))
+ (fcc (mh-identity-field identity "Fcc"))
+ (bcc (mh-identity-field identity "Bcc"))
+ comp-fcc comp-to comp-cc comp-bcc)
+ (if mh-redist-full-contents-flag
+ (mh-clean-msg-header
+ (point-min)
+ "^Message-Id:\\|^Received:\\|^Return-Path:\\|^Date:\\|^Resent-.*:"
+ nil))
+ ;; Read fields from the distcomps file and put them in our
+ ;; draft. For "To", "Cc", "Bcc", and "Fcc", multiple headers are
+ ;; combined into a single header with comma-separated entries.
+ ;; For "From", the first value wins, with the identity's "From"
+ ;; trumping anything in the distcomps file.
+ (let ((components-file (mh-bare-components mh-dist-formfile)))
+ (mh-mapc
+ (function
+ (lambda (header-field)
+ (let ((field (car header-field))
+ (value (cdr header-field))
+ (case-fold-search t))
+ (cond
+ ((string-match field "^Resent-Fcc$")
+ (setq comp-fcc value))
+ ((string-match field "^Resent-From$")
+ (or from
+ (setq from value)))
+ ((string-match field "^Resent-To$")
+ (setq comp-to value))
+ ((string-match field "^Resent-Cc$")
+ (setq comp-cc value))
+ ((string-match field "^Resent-Bcc$")
+ (setq comp-bcc value))
+ ((string-match field "^Resent-.*$")
+ (mh-insert-fields field value))))))
+ (mh-components-to-list components-file))
+ (delete-file components-file))
+ (mh-insert-fields "Resent-To:" (mapconcat 'identity (list to comp-to) ", ")
+ "Resent-Cc:" (mapconcat 'identity (list cc comp-cc) ", ")
+ "Resent-Fcc:" (mapconcat 'identity (list fcc
+ comp-fcc) ", ")
+ "Resent-Bcc:" (mapconcat 'identity (list bcc
+ comp-bcc) ", ")
+ "Resent-From:" from)
(save-buffer)
(message "Redistributing...")
(let ((env "mhdist=1"))
@@ -700,7 +751,8 @@ message and scan line."
;; Annotate...
(mh-annotate-msg message folder mh-note-dist
"-component" "Resent:"
- "-text" (format "\"%s %s\"" to cc)))
+ "-text" (format "\"To: %s Cc: %s From: %s\""
+ to cc from)))
(kill-buffer draft)
(message "Redistributing...done"))))
@@ -896,7 +948,7 @@ CONFIG is the window configuration before sending mail."
(message "Composing a message...")
(let ((draft (mh-read-draft
"message"
- (mh-bare-components)
+ (mh-bare-components mh-comp-formfile)
t)))
(mh-insert-fields "To:" to "Subject:" subject "Cc:" cc)
(goto-char (point-max))
@@ -906,23 +958,25 @@ CONFIG is the window configuration before sending mail."
(mh-letter-mode-message)
(mh-letter-adjust-point))))
-(defun mh-bare-components ()
- "Generate a temporary, clean components file and return its path."
- ;; Let comp(1) create the skeleton for us. This is particularly
+(defun mh-bare-components (formfile)
+ "Generate a temporary, clean components file from FORMFILE.
+Return the path to the temporary file."
+ ;; Let comp(1) create the skeleton for us. This is particularly
;; important with nmh-1.5, because its default "components" needs
- ;; some processing before it can be used. Unfortunately, comp(1)
- ;; doesn't have a -build option. So, to avoid the possibility of
- ;; clobbering an existing draft, create a temporary directory and
- ;; use it as the drafts folder. Then copy the skeleton to a regular
- ;; temp file, and return the regular temp file.
+ ;; some processing before it can be used. Unfortunately, comp(1)
+ ;; didn't have a -build option until later versions of nmh. So, to
+ ;; avoid the possibility of clobbering an existing draft, create
+ ;; a temporary directory and use it as the drafts folder. Then
+ ;; copy the skeleton to a regular temp file, and return the
+ ;; regular temp file.
(let (new
(temp-folder (make-temp-file
(concat mh-user-path "draftfolder.") t)))
(mh-exec-cmd "comp" "-nowhatnowproc"
"-draftfolder" (format "+%s"
(file-name-nondirectory temp-folder))
- (if (stringp mh-comp-formfile)
- (list "-form" mh-comp-formfile)))
+ (if (stringp formfile)
+ (list "-form" formfile)))
(setq new (make-temp-file "comp."))
(rename-file (concat temp-folder "/" "1") new t)
;; The temp folder could contain various metadata files. Rather
@@ -1056,6 +1110,7 @@ letter."
(defun mh-insert-x-mailer ()
"Append an X-Mailer field to the header.
The versions of MH-E, Emacs, and MH are shown."
+ (or mh-variant-in-use (mh-variant-set mh-variant))
;; Lazily initialize mh-x-mailer-string.
(when (and mh-insert-x-mailer-flag (null mh-x-mailer-string))
(setq mh-x-mailer-string
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index d84d3320426..eb173df47c9 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -65,7 +65,8 @@ Simulate NOERROR argument in XEmacs which lacks it."
Case is ignored if CASE-FOLD is non-nil.
This function is used by Emacs versions that lack `assoc-string',
introduced in Emacs 22."
- (if case-fold
+ ;; Test for fboundp is solely to silence compiler for Emacs >= 22.1.
+ (if (and case-fold (fboundp 'assoc-ignore-case))
(assoc-ignore-case key list)
(assoc key list)))
@@ -307,7 +308,8 @@ This function is used by XEmacs that lacks `replace-regexp-in-string'.
The function `replace-in-string' is used instead.
The arguments FIXEDCASE, SUBEXP, and START, used by
`replace-in-string' are ignored."
- (replace-in-string string regexp rep literal))
+ (if (featurep 'xemacs) ; silence Emacs compiler
+ (replace-in-string string regexp rep literal)))
(defun-mh mh-test-completion
test-completion (string collection &optional predicate)
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 571c0b5c4d3..3ff7765f395 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -410,6 +410,8 @@ gnus-version)
(require 'gnus)
gnus-version)
+(defvar mh-variant)
+
;;;###autoload
(defun mh-version ()
"Display version information about MH-E and the MH mail handling system."
@@ -430,6 +432,7 @@ gnus-version)
;; Emacs version.
(insert (emacs-version) "\n\n")
;; MH version.
+ (or mh-variant-in-use (mh-variant-set mh-variant))
(if mh-variant-in-use
(insert mh-variant-in-use "\n"
" mh-progs:\t" mh-progs "\n"
@@ -876,6 +879,7 @@ variant."
(defun mh-variant-p (&rest variants)
"Return t if variant is any of VARIANTS.
Currently known variants are `MH', `nmh', and `gnu-mh'."
+ (or mh-variant-in-use (mh-variant-set mh-variant))
(let ((variant-in-use
(cadr (assoc 'variant (assoc mh-variant-in-use (mh-variants))))))
(not (null (member variant-in-use variants)))))
@@ -941,6 +945,8 @@ finally GNU mailutils MH."
(when (not (mh-variant-set-variant variant))
(message "Warning: %s variant not found. Autodetecting..." variant)
(mh-variant-set 'autodetect)))
+ ((null valid-list)
+ (message "Unknown variant %s; can't find MH anywhere" variant))
(t
(message "Unknown variant %s; use %s"
variant
@@ -972,6 +978,7 @@ necessary and can actually cause problems."
:set (lambda (symbol value)
(set-default symbol value) ;Done in mh-variant-set-variant!
(mh-variant-set value))
+ :initialize 'custom-initialize-default
:group 'mh-e
:package-version '(MH-E . "8.0"))
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index e4429df501a..caf40715831 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -519,7 +519,7 @@ font-lock is done highlighting.")
(defmacro mh-remove-xemacs-horizontal-scrollbar ()
"Get rid of the horizontal scrollbar that XEmacs insists on putting in."
(when (featurep 'xemacs)
- `(if (and (featurep 'scrollbar)
+ '(if (and (featurep 'scrollbar)
(fboundp 'set-specifier))
(set-specifier horizontal-scrollbar-visible-p nil
(cons (current-buffer) nil)))))
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index d9b3dc8233f..da7c87ea81b 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -357,6 +357,8 @@ Arguments are IGNORED (for `revert-buffer')."
(yes-or-no-p "Undo all commands in folder? "))
(setq mh-delete-list nil
mh-refile-list nil
+ mh-blacklist nil
+ mh-whitelist nil
mh-seq-list nil
mh-next-direction 'forward)
(with-mh-folder-updating (nil)
diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el
index 8469843e3fc..1d929e8f990 100644
--- a/lisp/mh-e/mh-identity.el
+++ b/lisp/mh-e/mh-identity.el
@@ -132,6 +132,33 @@ valid header field."
'mh-identity-handler-default))
;;;###mh-autoload
+(defun mh-select-identity (default)
+ "Prompt for and return an identity.
+If DEFAULT is non-nil, it will be used if the user doesn't enter a
+different identity.
+
+See `mh-identity-list'."
+ (let (identity)
+ (setq identity
+ (completing-read
+ "Identity: "
+ (cons '("None")
+ (mapcar 'list (mapcar 'car mh-identity-list)))
+ nil t default nil default))
+ (if (eq identity "None")
+ nil
+ identity)))
+
+;;;###mh-autoload
+(defun mh-identity-field (identity field)
+ "Return the specified FIELD of the given IDENTITY.
+
+See `mh-identity-list'."
+ (let* ((pers-list (cadr (assoc identity mh-identity-list)))
+ (value (cdr (assoc field pers-list))))
+ value))
+
+;;;###mh-autoload
(defun mh-insert-identity (identity &optional maybe-insert)
"Insert fields specified by given IDENTITY.
diff --git a/lisp/mh-e/mh-junk.el b/lisp/mh-e/mh-junk.el
index 8266d96ca69..db80f90494e 100644
--- a/lisp/mh-e/mh-junk.el
+++ b/lisp/mh-e/mh-junk.el
@@ -108,8 +108,7 @@ message(s) as specified by the option `mh-junk-disposition'."
(mh-iterate-on-range msg range
(message "Blacklisting message %d..." msg)
(funcall (symbol-function blacklist-func) msg)
- (message "Blacklisting message %d...done" msg))
- (mh-next-msg)))
+ (message "Blacklisting message %d...done" msg))))
;;;###mh-autoload
(defun mh-junk-whitelist (range)
@@ -164,8 +163,7 @@ classified as spam (see the option `mh-junk-program')."
(mh-iterate-on-range msg range
(message "Whitelisting message %d..." msg)
(funcall (symbol-function whitelist-func) msg)
- (message "Whitelisting message %d...done" msg))
- (mh-next-msg)))
+ (message "Whitelisting message %d...done" msg))))
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index 4906c98bb89..4fc31ed1218 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -60,17 +60,6 @@
(to . mh-alias-letter-expand-alias))
"Alist of header fields and completion functions to use.")
-(defvar mh-yank-hooks nil
- "Obsolete hook for modifying a citation just inserted in the mail buffer.
-
-Each hook function can find the citation between point and mark.
-And each hook function should leave point and mark around the
-citation text as modified.
-
-This is a normal hook, misnamed for historical reasons.
-It is obsolete and is only used if `mail-citation-hook' is nil.")
-(mh-make-obsolete-variable 'mh-yank-hooks 'mail-citation-hook "19.34")
-
;;; Letter Menu
@@ -972,8 +961,6 @@ Otherwise, simply insert MH-INS-STRING before each line."
(sc-cite-original))
(mail-citation-hook
(run-hooks 'mail-citation-hook))
- (mh-yank-hooks ;old hook name
- (run-hooks 'mh-yank-hooks))
(t
(or (bolp) (forward-line 1))
(while (< (point) (point-max))
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index bb7bf826497..9901548b904 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -75,7 +75,7 @@
;;;###mh-autoload
(defmacro mh-buffer-data ()
"Convenience macro to get the MIME data structures of the current buffer."
- `(gethash (current-buffer) mh-globals-hash))
+ '(gethash (current-buffer) mh-globals-hash))
;; Structure to keep track of MIME handles on a per buffer basis.
(mh-defstruct (mh-buffer-data (:conc-name mh-mime-)
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index 84a7a817065..7dad81dbce5 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -375,8 +375,8 @@ still visible.\n")
(cond ((not normal-exit)
(set-window-configuration config))
,(if dont-return
- `(t (setq mh-previous-window-config config))
- `((and (get-buffer cur-buffer-name)
+ '(t (setq mh-previous-window-config config))
+ '((and (get-buffer cur-buffer-name)
(window-live-p (get-buffer-window
(get-buffer cur-buffer-name))))
(pop-to-buffer (get-buffer cur-buffer-name) nil)))))))))
@@ -774,7 +774,7 @@ operation."
("^\\(Apparently-To:\\|Newsgroups:\\)\\(.*\\)"
(1 'default)
(2 'mh-show-cc))
- ("^\\(In-reply-to\\|Date\\):\\(.*\\)$"
+ ("^\\(In-Reply-To\\|Date\\):\\(.*\\)$"
(1 'default)
(2 'mh-show-date))
(mh-letter-header-font-lock
diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el
index dd4f6037050..3e89d1b65e9 100644
--- a/lisp/mh-e/mh-speed.el
+++ b/lisp/mh-e/mh-speed.el
@@ -163,7 +163,7 @@ The optional arguments from speedbar are IGNORED."
(speedbar-change-expand-button-char ?-)
(add-text-properties
(mh-line-beginning-position) (1+ (line-beginning-position))
- `(mh-expanded t)))))))
+ '(mh-expanded t)))))))
(defun mh-speed-view (&rest ignored)
"Visits the selected folder just as if you had used \\<mh-folder-mode-map>\\[mh-visit-folder].
@@ -199,7 +199,7 @@ created."
(1+ (mh-line-beginning-position))))
(add-text-properties
(mh-line-beginning-position) (1+ (line-beginning-position))
- `(mh-folder nil mh-expanded nil mh-children-p t mh-level 0))
+ '(mh-folder nil mh-expanded nil mh-children-p t mh-level 0))
(mh-speed-stealth-update t)
(when (> mh-speed-update-interval 0)
(mh-speed-flists nil))))
@@ -568,7 +568,7 @@ The function invalidates the latest ancestor that is present."
(mh-speedbar-change-expand-button-char ?+)
(add-text-properties
(mh-line-beginning-position) (1+ (mh-line-beginning-position))
- `(mh-children-p t)))
+ '(mh-children-p t)))
(when (get-text-property (mh-line-beginning-position) 'mh-expanded)
(mh-speed-toggle))
(setq mh-speed-refresh-flag t))))
diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el
index 7d35bc61de8..0fc560b90d0 100644
--- a/lisp/mh-e/mh-thread.el
+++ b/lisp/mh-e/mh-thread.el
@@ -647,20 +647,17 @@ Only information about messages in MSG-LIST are added to the tree."
(defun mh-thread-set-tables (folder)
"Use the tables of FOLDER in current buffer."
- (mh-flet
- ((mh-get-table (symbol)
- (with-current-buffer folder
- (symbol-value symbol))))
- (setq mh-thread-id-hash (mh-get-table 'mh-thread-id-hash))
- (setq mh-thread-subject-hash (mh-get-table 'mh-thread-subject-hash))
- (setq mh-thread-id-table (mh-get-table 'mh-thread-id-table))
- (setq mh-thread-id-index-map (mh-get-table 'mh-thread-id-index-map))
- (setq mh-thread-index-id-map (mh-get-table 'mh-thread-index-id-map))
- (setq mh-thread-scan-line-map (mh-get-table 'mh-thread-scan-line-map))
- (setq mh-thread-subject-container-hash
- (mh-get-table 'mh-thread-subject-container-hash))
- (setq mh-thread-duplicates (mh-get-table 'mh-thread-duplicates))
- (setq mh-thread-history (mh-get-table 'mh-thread-history))))
+ (dolist (v '(mh-thread-id-hash
+ mh-thread-subject-hash
+ mh-thread-id-table
+ mh-thread-id-index-map
+ mh-thread-index-id-map
+ mh-thread-scan-line-map
+ mh-thread-subject-container-hash
+ mh-thread-duplicates
+ mh-thread-history))
+ ;; Emacs >= 22.1: (buffer-local-value v folder).
+ (set v (with-current-buffer folder (symbol-value v)))))
(defun mh-thread-process-in-reply-to (reply-to-header)
"Extract message id's from REPLY-TO-HEADER.
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index 34f902a65e6..9526338b8ff 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -177,6 +177,7 @@ been set. This hook can be used the change the value of these
variables if you need to run with different values between MH and
MH-E."
(unless mh-find-path-run
+ (or mh-variant-in-use (mh-variant-set mh-variant))
;; Sanity checks.
(if (and (getenv "MH")
(not (file-readable-p (getenv "MH"))))