Commit a05fcb7d authored by Bill Wohler's avatar Bill Wohler
Browse files

* mh-init.el (mh-image-load-path): New function that adds the path to

the MH-E images to the image-load-path or load-path depending on the
version of Emacs.

* mh-customize.el: Call mh-image-load-path just before
mh-tool-bar-define so that the toolbar images can be found.

* mh-customize.el (mh-invisible-header-fields-internal)
(mh-invisible-header-fields-internal): Add Received-SPF header and
X-Gmail- prefixes seen from Gmail. Jeffrey C Honig
<jch@honig.net>

* mh-customize.el (mh-customize): Use customization group mh-e.

* mh-e.el (desktop-buffer-mode-handlers): Only add to this list if
the variable exists. Not present pre-version 22.
(Version, mh-version): Added +cvs to version.

* mh-unit.el (mh-unit): Changed lm-verify test to Emacs 22.

* Makefile: Incorporated ideas from Clemens Fruhwirth to
generalize mh-loaddefs.el to make it work for both GNU Emacs and
XEmacs.
(EMACS_OPTIONS, XEMACS_OPTIONS): Use double-dash for all long
options.
(EMACS_LOADDEFS_COOKIE): New variable for generate-autoload-cookie
setting. Obsoletes XEMACS_LOADDEFS_COOKIE.
(EMACS_EXPORT_MH_LOADDEFS): New variable for GNU Emacs commands to
rebuild mh-loaddefs.el.
(XEMACS_EXPORT_MH_LOADDEFS): New variable for XEmacs commands to
rebuild mh-loaddefs.el. Obsoletes XEMACS_LOADDEFS_FILE and
XEMACS_LOADDEFS_PKG_NAME.
(MH-E-LOADDEFS-SRC): New variable which is set to $(MH-E-SRC) on
GNU Emacs, and adds $(MH-E-XEMACS-SRC) on XEmacs.
(all): Modify EMACS_EXPORT_MH_LOADDEFS and MH-E-LOADDEFS-SRC on
XEMacs.
(mh-loaddefs.el): Now depends on $(MH-E-LOADDEFS-SRC) and has
generic compile command that works on both GNU Emacs XEmacs.
(xemacs): Depend on autoloads instead of deleted loaddefs-xemacs.
(loaddefs-xemacs): Deleted.

* mh-comp.el (mh-font-lock-field-data): Fix a bug where the
function would return t but match-data was being set to nil
(closes SF #1241017). Satyaki Das  <satyaki@theforce.stanford.edu>.

* mh-comp.el (mh-insert-auto-fields): Inset identity regardless of
whether one was already set, since if one used a default identity
it would never be overridden. Peter S Galbraith
<psg@debian.org>

* mh-init.el (mh-path): Use customization group mh-e. Thanks to
Peter Whaite for these patches (closes SF #1213716).

* mh-mime.el (mh-compose-forward): Only use mh-sent-from-msg as a
default message if it's a number (as is done elsewhere).
Otherwise, an error is thrown if this function is called from a
draft created by mh-forward since this variable is a list. Also
added a space after the "Messages [%s]:" prompt.

* mh-mime.el (mh-compose-forward): Allow insertion of multiple
forwarded messages by range (including sequences).  For the sent
folder the default message presented is the sent message.  For
other folders, the default message is "cur", if it exists.
Jeffrey C Honig  <jch@honig.net>
parent f9e36a6d
This diff is collapsed.
This diff is collapsed.
;;; mh-alias.el --- MH-E mail alias completion and expansion
;;
;; Copyright (C) 1994, 1995, 1996, 1997,
;; 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
;; 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Author: Peter S. Galbraith <psg@debian.org>
;; Maintainer: Bill Wohler <wohler@newt.com>
......
;;; mh-comp.el --- MH-E functions for composing messages
;; Copyright (C) 1993, 1995, 1997,
;; 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
;; 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Author: Bill Wohler <wohler@newt.com>
;; Maintainer: Bill Wohler <wohler@newt.com>
......@@ -979,11 +979,13 @@ When a message is composed, the hooks `text-mode-hook' and
(setq data-begin (match-end 0))
(setq field (match-string 1)))
(setq data-begin (max point data-begin))
(if (and field (mh-letter-skipped-header-field-p field))
(set-match-data nil)
(set-match-data (list data-begin data-end data-begin data-end)))
(goto-char (if (equal point data-end) (1+ data-end) data-end))
t)))
(cond ((and field (mh-letter-skipped-header-field-p field))
(set-match-data nil)
nil)
(t (set-match-data
(list data-begin data-end data-begin data-end))
t)))))
(defun mh-letter-header-end ()
"Find the end of the message header.
......@@ -1243,8 +1245,12 @@ Return t if fields added; otherwise return nil."
(value (cdar entry-list)))
(cond
((equal ":identity" field)
(when (and (not mh-identity-local)
(assoc value mh-identity-list))
(when ;;(and (not mh-identity-local)
;; Bug 1204506. But do we need to be able
;; to set an identity manually that won't be
;; overridden by mh-insert-auto-fields?
(assoc value mh-identity-list)
;;)
(mh-insert-identity value)))
(t
(mh-modify-header-field field value
......
......@@ -88,15 +88,16 @@
If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in
the frame are removed."
(interactive "P")
(customize-group 'mh)
(customize-group 'mh-e)
(when delete-other-windows-flag
(delete-other-windows)))
;;; For compiler warnings...
(defvar mh-show-buffer)
(defvar mh-show-folder-buffer)
(eval-when-compile
(defvar mh-show-buffer)
(defvar mh-show-folder-buffer))
;;; MH-E Customization Groups
......@@ -301,8 +302,8 @@ aliases or addresses. The default setting flashes the address associated with
an address in the minibuffer briefly, but does not display a warning if the
alias is not found."
:type '(choice (const :tag "Flash but Don't Warn If No Alias" t)
(const :tag "Flash and Warn If No Alias" 1)
(const :tag "Don't Flash Nor Warn If No Alias" nil))
(const :tag "Flash and Warn If No Alias" 1)
(const :tag "Don't Flash Nor Warn If No Alias" nil))
:group 'mh-alias)
(defcustom mh-alias-insert-file nil
......@@ -1214,6 +1215,7 @@ The gnus method uses a different color for each indentation."
"Prev-Resent" ; MH
"Priority:"
"Received:" ; RFC 822
"Received-SPF:" ; Gmail
"References:"
"Remailed-" ; MH
"Replied:" ; MH
......@@ -1246,10 +1248,11 @@ The gnus method uses a different color for each indentation."
"X-Envelope-From:"
"X-Envelope-Sender:"
"X-Envelope-To:"
"X-Evolution:" ; Evolution mail client
"X-Evolution:" ; Evolution mail client
"X-Face:"
"X-Folder:" ; Spam
"X-From-Line"
"X-Gmail-" ; Gmail
"X-Gnus-Mail-Source:" ; gnus
"X-Greylist:" ; milter-greylist-1.2.1
"X-Habeas-SWE-1:" ; Spam
......@@ -1274,7 +1277,7 @@ The gnus method uses a different color for each indentation."
"X-MIME-Autoconverted:" ; sendmail
"X-MIMETrack:"
"X-Mms-" ; T-Mobile pictures
"X-MS-" ; MS Outlook
"X-MS-" ; MS Outlook
"X-MailScanner" ; ListProc(tm) by CREN
"X-Mailing-List:" ; Unknown mailing list managers
"X-Mailman-Version:" ; Mailman mailing list manager
......@@ -1894,6 +1897,7 @@ where,
for y in letter-docs
collect `(const :tag ,y ,x)))))))
(mh-image-load-path)
(mh-tool-bar-define
((:folder mh-inc-folder mh-mime-save-parts mh-previous-undeleted-msg
mh-page-msg mh-next-undeleted-msg mh-delete-msg mh-refile-msg
......
......@@ -6,7 +6,7 @@
;; Author: Bill Wohler <wohler@newt.com>
;; Maintainer: Bill Wohler <wohler@newt.com>
;; Version: 7.84
;; Version: 7.84+cvs
;; Keywords: mail
;; This file is part of GNU Emacs.
......@@ -98,7 +98,7 @@
(defvar font-lock-auto-fontify)
(defvar font-lock-defaults)
(defconst mh-version "7.84" "Version number of MH-E.")
(defconst mh-version "7.84+cvs" "Version number of MH-E.")
(defvar mh-partial-folder-mode-line-annotation "select"
"Annotation when displaying part of a folder.
......@@ -1667,8 +1667,10 @@ DESKTOP-BUFFER-MISC holds a list of miscellaneous info used by the
(mh-visit-folder desktop-buffer-name)
(current-buffer))
(add-to-list 'desktop-buffer-mode-handlers
'(mh-folder-mode . mh-restore-desktop-buffer))
;;; desktop-buffer-mode-handlers appeared in Emacs 22.
(if (fboundp 'desktop-buffer-mode-handlers)
(add-to-list 'desktop-buffer-mode-handlers
'(mh-folder-mode . mh-restore-desktop-buffer)))
(defun mh-scan-folder (folder range &optional dont-exec-pending)
"Scan the FOLDER over the RANGE.
......
;;; mh-identity.el --- Multiple identify support for MH-E.
;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Author: Peter S. Galbraith <psg@debian.org>
;; Maintainer: Bill Wohler <wohler@newt.com>
......
......@@ -41,6 +41,9 @@
(mh-require-cl)
(require 'mh-utils)
;;; Avoid compiler warnings.
(eval-when-compile (defvar image-load-path))
;;; Set for local environment:
;;; mh-progs and mh-lib used to be set in paths.el, which tried to
;;; figure out at build time which of several possible directories MH
......@@ -170,7 +173,7 @@ directories to the customizable variable `mh-path'.")
"*List of directories to search for variants of the MH variant.
The directories will be searched for `mhparam' in addition to directories
listed in `mh-sys-path' and `exec-path'."
:group 'mh
:group 'mh-e
:type '(repeat (directory)))
(defvar mh-variants nil
......@@ -297,6 +300,51 @@ by the variable `mh-variants'."
(add-to-list 'mh-variants variant)))))
mh-variants)))
;;; XXX The two calls to message in this function should really be calls to
;;; error. However, when this function is compiled via the top-level call in
;;; mh-customize.el, it is actually called, and in a compile environment, the
;;; errors are triggered which botches the compile. As a workaround, the calls
;;; to error have been changed to calls to message, and code following was
;;; inserted as an else clause. This is not robust, so if you can fix this,
;;; please do!
;;;###mh-autoload
(defun mh-image-load-path ()
"Ensure that the MH-E images are accessible by `find-image'.
Images for MH-E are found in ../../etc/images relative to the files in
lisp/mh-e. If `image-load-path' exists (since Emacs 22), then the images
directory is added to it if isn't already there. Otherwise, the images
directory is added to the `load-path' if it isn't already there."
(let (mh-load-path mh-image-load-path)
;; First, find mh-e in the load-path.
(let ((path load-path))
(while path
(let* ((directory (directory-file-name (car path))))
(setq mh-load-path
(if (and (equal (file-name-nondirectory directory) "mh-e")
(file-exists-p directory))
directory
nil))
(setq path (if mh-load-path nil (cdr path)))))
(if (not mh-load-path)
;; This message be error; there shouldn't be an else. Blame compiler.
(message "Can not find mh-e in load-path (OK when compiling)")
;; Create the image path associated with this mh-e directory.
(setq mh-image-load-path (expand-file-name
(concat (file-name-directory mh-load-path)
"../etc/images")))))
(if (or (not mh-image-load-path)
(not (file-exists-p mh-image-load-path)))
;; This message be error; there shouldn't be an else. Blame compiler.
(message "Can not find image directory %s (OK when compiling)"
mh-image-load-path)
;; If image-load-path exists, and the image path isn't there add it.
(if (boundp 'image-load-path)
(if (not (member mh-image-load-path image-load-path))
(push mh-image-load-path image-load-path))
;; Otherwise, if the image path isn't in the load-path, add it there.
(if (not (member mh-image-load-path load-path))
(push mh-image-load-path load-path))))))
(provide 'mh-init)
;;; Local Variables:
......
;;; mh-junk.el --- Interface to anti-spam measures
;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
;; Author: Satyaki Das <satyaki@theforce.stanford.edu>,
;; Bill Wohler <wohler@newt.com>
......
......@@ -69,25 +69,45 @@ Optional argument INLINE means make it an inline attachment."
(call-interactively 'mh-mhn-compose-insertion)))
;;;###mh-autoload
(defun mh-compose-forward (&optional description folder message)
(defun mh-compose-forward (&optional description folder messages)
"Add a MIME directive to forward a message, using mhn or gnus.
If the variable `mh-compose-insertion' is set to 'mhn, then that will be used.
If it is set to 'gnus, then that will be used instead.
Optional argument DESCRIPTION is a description of the attachment.
Optional argument FOLDER is the folder from which the forwarded message should
come.
Optional argument MESSAGE is the message to forward.
Optional argument MESSAGES is the range of messages to forward.
If any of the optional arguments are absent, they are prompted for."
(interactive (list
(read-string "Forw Content-description: ")
(mh-prompt-for-folder "Message from" mh-sent-from-folder nil)
(read-string (concat "Messages"
(if (numberp mh-sent-from-msg)
(format " (default %d): " mh-sent-from-msg)
": ")))))
(if (equal mh-compose-insertion 'gnus)
(mh-mml-forward-message description folder message)
(mh-mhn-compose-forw description folder message)))
(interactive (let*
((description (read-string "Forw Content-description: "))
(folder (mh-prompt-for-folder "Message from"
mh-sent-from-folder nil))
(messages (let ((default-message
(if (and (equal
folder mh-sent-from-folder)
(numberp mh-sent-from-msg))
mh-sent-from-msg
(nth 0 (mh-translate-range
folder "cur")))))
(if default-message
(read-string
(format "Messages (default %d): "
default-message)
nil nil
(number-to-string default-message))
(read-string (format "Messages: "))))))
(list description folder messages)))
(let
((range))
(if (null messages)
(setq messages ""))
(setq range (mh-translate-range folder messages))
(if (null range)
(error "No messages in specified range"))
(dolist (message range)
(if (equal mh-compose-insertion 'gnus)
(mh-mml-forward-message description folder (format "%s" message))
(mh-mhn-compose-forw description folder message)))))
;; To do:
;; paragraph code should not fill # lines if MIME enabled.
......
;;; mh-print.el --- MH-E printing support
;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
;; Author: Jeffrey C Honig <jch@honig.net>
;; Maintainer: Bill Wohler <wohler@newt.com>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment