Add arch tagline
[emacs.git] / lisp / mh-e / mh-compat.el
blob452d0a3c089294196f3092f91d36b125f0b87a74
1 ;;; mh-compat.el --- make MH-E compatibile with various versions of Emacs
3 ;; Copyright (C) 2006 Free Software Foundation, Inc.
5 ;; Author: Bill Wohler <wohler@newt.com>
6 ;; Maintainer: Bill Wohler <wohler@newt.com>
7 ;; Keywords: mail
8 ;; See: mh-e.el
10 ;; This file is part of GNU Emacs.
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.
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.
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.
27 ;;; Commentary:
29 ;;; Change Log:
31 ;;; Code:
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.
39 ;; See also mh-gnus.el for compatibility macros used to span different
40 ;; versions of Gnus.
42 ;; Macros are listed alphabetically.
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))))
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)))
64 (provide 'mh-compat)
66 ;; Local Variables:
67 ;; no-byte-compile: t
68 ;; indent-tabs-mode: nil
69 ;; sentence-end-double-space: nil
70 ;; End:
72 ;; arch-tag: 577b0eab-a5cd-45e1-8d9f-c1a426f4d73c
73 ;;; mh-compat.el ends here