emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116682: * lisp/mh-e/mh-compat.el (mh-display-comple


From: Glenn Morris
Subject: [Emacs-diffs] trunk r116682: * lisp/mh-e/mh-compat.el (mh-display-completion-list): Replace use of obsolete
Date: Thu, 06 Mar 2014 02:02:49 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116682
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2014-03-05 21:02:46 -0500
message:
  * lisp/mh-e/mh-compat.el (mh-display-completion-list): Replace use of obsolete
  argument of display-completion-list.
modified:
  lisp/mh-e/ChangeLog            changelog-20091113204419-o5vbwnq5f7feedwu-2547
  lisp/mh-e/mh-compat.el         
mhcompat.el-20091113204419-o5vbwnq5f7feedwu-4348
=== modified file 'lisp/mh-e/ChangeLog'
--- a/lisp/mh-e/ChangeLog       2014-03-03 04:57:26 +0000
+++ b/lisp/mh-e/ChangeLog       2014-03-06 02:02:46 +0000
@@ -1,3 +1,8 @@
+2014-03-06  Glenn Morris  <address@hidden>
+
+       * mh-compat.el (mh-display-completion-list):
+       Replace use of obsolete argument of display-completion-list.
+
 2013-11-05  Stefan Monnier  <address@hidden>
 
        * mh-print.el (mh-ps-print-preprint): Don't use dynamic-var

=== modified file 'lisp/mh-e/mh-compat.el'
--- a/lisp/mh-e/mh-compat.el    2014-01-01 07:43:34 +0000
+++ b/lisp/mh-e/mh-compat.el    2014-03-06 02:02:46 +0000
@@ -96,12 +96,18 @@
 (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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]