Initial Commit
[packages] / xemacs-packages / mh-e / mh-xemacs-compat.el
1 ;;; mh-xemacs-compat.el --- GNU Emacs Functions needed by XEmacs
2
3 ;; Copyright (C) 2001, 02, 2003 Free Software Foundation, Inc.
4
5 ;; Author: FSF
6 ;; Maintainer: Bill Wohler <wohler@newt.com>
7 ;; Keywords: mail
8 ;; See: mh-e.el
9
10 ;; This file is part of GNU Emacs.
11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; any later version.
16
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 ;; GNU General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
26
27 ;;; Commentary:
28
29 ;;; Change Log:
30
31 ;;; Code:
32
33 ;;; Some requires:
34 (require 'rfc822)
35
36 (eval-when-compile (require 'mh-utils))
37
38 ;;; Simple compatibility:
39
40 (unless (fboundp 'match-string-no-properties)
41   (defsubst match-string-no-properties (match)
42     (buffer-substring-no-properties
43      (match-beginning match) (match-end match))))
44
45 (unless (fboundp 'line-beginning-position)
46   (defalias 'line-beginning-position 'point-at-bol))
47 (unless (fboundp 'line-end-position)
48   (defalias 'line-end-position 'point-at-eol))
49
50 (unless (fboundp 'timerp)
51   (defalias 'timerp 'itimerp))
52 (unless (fboundp 'cancel-timer)
53   (defalias 'cancel-timer 'delete-itimer))
54
55 ;; Set up the modeline glyph
56 (defconst mh-modeline-logo
57   "/* XPM */
58 static char * file[] = {
59 \"18 13 2 1\",
60 \"# c #666699\",
61 \". c None s None\",
62 \"........##........\",
63 \".......####.......\",
64 \"......######......\",
65 \"......######......\",
66 \"....#########.....\",
67 \"..##############..\",
68 \".##...######....#.\",
69 \"##...#.#.####...#.\",
70 \"....#..#.##.#...#.\",
71 \"...#..##.#.#.#....\",
72 \"...#..#..#..#.#...\",
73 \"...#..#.##..#.##..\",
74 \"...#..#.#..#....#.\"};"
75   "The image for the modeline logo.")
76
77 (mh-do-in-xemacs
78   (defvar mh-modeline-glyph
79     (progn
80       (let* ((data mh-modeline-logo)
81              (glyph (make-glyph
82                      (cond ((and (featurep 'xpm)
83                                  (device-on-window-system-p)
84                                  has-modeline-p)
85                             `[xpm :data ,data])
86                            (t [string :data "MH-E"])))))
87         (set-glyph-face glyph 'modeline-buffer-id)
88         glyph))
89     "Cute little logo to put in the modeline of MH-E buffers."))
90
91 (provide 'mh-xemacs-compat)
92
93 ;;; Local Variables:
94 ;;; indent-tabs-mode: nil
95 ;;; sentence-end-double-space: nil
96 ;;; End:
97
98 ;;; mh-xemacs-compat.el ends here