;;; mh-utils.el --- MH-E general utilities
;; Copyright (C) 1993, 1995, 1997,
-;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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:
;;;###mh-autoload
(defun mh-colors-available-p ()
"Check if colors are available in the Emacs being used."
- (or mh-xemacs-flag
+ (or (featurep 'xemacs)
(let ((color-cells (mh-display-color-cells)))
(and (numberp color-cells) (>= color-cells 8)))))
(getenv "MH")))
(if (null (mh-variants))
(error "Install MH and run install-mh before running MH-E"))
- (let ((profile "~/.mh_profile"))
- (if (not (file-readable-p profile))
- (error "Run install-mh before running MH-E")))
+ (if (not (or (getenv "MH") (file-readable-p "~/.mh_profile")))
+ (error "Run install-mh before running MH-E"))
;; Read MH profile.
(setq mh-user-path (mh-profile-component "Path"))
(if (not mh-user-path)
"Display cheat sheet for the commands of the current prefix in minibuffer."
(interactive)
;; We got here because the user pressed a "?", but he pressed a prefix key
- ;; before that. Since the the key vector starts at index 0, the index of the
+ ;; before that. Since the key vector starts at index 0, the index of the
;; last keystroke is length-1 and thus the second to last keystroke is at
;; length-2. We use that information to obtain a suitable prefix character
;; from the recent keys.
;;;###mh-autoload
(defun mh-goto-header-end (arg)
"Move the cursor ARG lines after the header."
- (if (re-search-forward "^-*$" nil nil)
+ (if (re-search-forward (concat "^\\(" (regexp-quote mh-mail-header-separator)
+ "\\)?$") nil nil)
(forward-line arg)))
;;;###mh-autoload