summaryrefslogtreecommitdiff
path: root/lisp/mh-e/mh-compat.el
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@raeburn.org>2015-11-01 01:42:21 -0400
committerKen Raeburn <raeburn@raeburn.org>2015-11-01 01:42:21 -0400
commit39372e1a1032521be74575bb06f95a3898fbae30 (patch)
tree754bd242a23d2358ea116126fcb0a629947bd9ec /lisp/mh-e/mh-compat.el
parent6a3121904d76e3b2f63007341d48c5c1af55de80 (diff)
parente11aaee266da52937a3a031cb108fe13f68958c3 (diff)
downloademacs-39372e1a1032521be74575bb06f95a3898fbae30.tar.gz
merge from trunk
Diffstat (limited to 'lisp/mh-e/mh-compat.el')
-rw-r--r--lisp/mh-e/mh-compat.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index b755572c957..9865d085444 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -1,6 +1,6 @@
;;; mh-compat.el --- make MH-E compatible with various versions of Emacs
-;; Copyright (C) 2006-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2015 Free Software Foundation, Inc.
;; Author: Bill Wohler <wohler@newt.com>
;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -96,12 +96,18 @@ expected to return an integer."
(defmacro mh-display-completion-list (completions &optional common-substring)
"Display the list of COMPLETIONS.
See documentation for `display-completion-list' for a description of the
-arguments COMPLETIONS and perhaps COMMON-SUBSTRING.
-This macro is used by Emacs versions that lack a COMMON-SUBSTRING
-argument, introduced in Emacs 22."
- (if (< emacs-major-version 22)
- `(display-completion-list ,completions)
- `(display-completion-list ,completions ,common-substring)))
+arguments COMPLETIONS.
+The optional argument COMMON-SUBSTRING, if non-nil, should be a string
+specifying a common substring for adding the faces
+`completions-first-difference' and `completions-common-part' to
+the completions."
+ (cond ((< emacs-major-version 22) `(display-completion-list ,completions))
+ ((fboundp 'completion-hilit-commonality) ; Emacs 23.1 and later
+ `(display-completion-list
+ (completion-hilit-commonality ,completions
+ ,(length common-substring) nil)))
+ (t ; Emacs 22
+ `(display-completion-list ,completions ,common-substring))))
(defmacro mh-face-foreground (face &optional frame inherit)
"Return the foreground color name of FACE, or nil if unspecified.
@@ -156,7 +162,7 @@ compatibility with versions of Emacs that lack the variable
(let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
(image-load-path (cons (car load-path)
- (when (boundp 'image-load-path)
+ (when (boundp \\='image-load-path)
image-load-path))))
(mh-tool-bar-folder-buttons-init))"
(unless library (error "No library specified"))