68465
|
1 ;;; mh-compat.el --- make MH-E compatibile with various versions of Emacs
|
|
2
|
|
3 ;; Copyright (C) 2006 Free Software Foundation, Inc.
|
|
4
|
|
5 ;; Author: Bill Wohler <wohler@newt.com>
|
|
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., 51 Franklin Street, Fifth Floor,
|
|
25 ;; Boston, MA 02110-1301, USA.
|
|
26
|
|
27 ;;; Commentary:
|
|
28
|
|
29 ;;; Change Log:
|
|
30
|
|
31 ;;; Code:
|
|
32
|
|
33 ;; This is a good place to gather code that is used for compatibility
|
|
34 ;; between different versions of Emacs. Please document which versions
|
|
35 ;; of Emacs that the defsubst, defalias, or defmacro applies. That
|
|
36 ;; way, it's easy to occasionally go through this file and see which
|
|
37 ;; macros we can retire.
|
|
38
|
|
39 ;; See also mh-gnus.el for compatibility macros used to span different
|
|
40 ;; versions of Gnus.
|
|
41
|
|
42 ;; Macros are listed alphabetically.
|
|
43
|
|
44 (unless (fboundp 'assoc-string)
|
|
45 (defsubst assoc-string (key list case-fold)
|
|
46 "Like `assoc' but specifically for strings.
|
|
47 Case is ignored if CASE-FOLD is non-nil.
|
|
48 This function added by MH-E for Emacs versions that lack
|
|
49 `assoc-string', introduced in Emacs 22."
|
|
50 (if case-fold
|
|
51 (assoc-ignore-case key list)
|
|
52 (assoc key list))))
|
|
53
|
|
54 (defmacro mh-display-completion-list (completions &optional common-substring)
|
|
55 "Display the list of COMPLETIONS.
|
|
56 Calls `display-completion-list' correctly in older environments.
|
|
57 Versions of Emacs prior to version 22 lacked a COMMON-SUBSTRING
|
|
58 argument which is used to highlight the next possible character you
|
|
59 can enter in the current list of completions."
|
|
60 (if (< emacs-major-version 22)
|
|
61 `(display-completion-list ,completions)
|
|
62 `(display-completion-list ,completions ,common-substring)))
|
|
63
|
|
64 (provide 'mh-compat)
|
|
65
|
|
66 ;; Local Variables:
|
|
67 ;; no-byte-compile: t
|
|
68 ;; indent-tabs-mode: nil
|
|
69 ;; sentence-end-double-space: nil
|
|
70 ;; End:
|
|
71
|
|
72 ;;; mh-compat.el ends here
|