]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/mh-e/mh-compat.el (mh-display-completion-list): Replace use of obsolete
authorGlenn Morris <rgm@gnu.org>
Thu, 6 Mar 2014 02:02:46 +0000 (21:02 -0500)
committerGlenn Morris <rgm@gnu.org>
Thu, 6 Mar 2014 02:02:46 +0000 (21:02 -0500)
argument of display-completion-list.

lisp/mh-e/ChangeLog
lisp/mh-e/mh-compat.el

index 9b00e2de614e31f4102e6048f63f2a695f6bb791..da6895eaf3977d4fef8f7c78e83870732cf9c8ac 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-06  Glenn Morris  <rgm@gnu.org>
+
+       * mh-compat.el (mh-display-completion-list):
+       Replace use of obsolete argument of display-completion-list.
+
 2013-11-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * mh-print.el (mh-ps-print-preprint): Don't use dynamic-var
index af9f1364970bf6ea214fa3aadca15cfb1aa797b6..db46be7bec44a337e105dcc751d4a6adf232d021 100644 (file)
@@ -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.