emacs-diffs
[Top][All Lists]
Advanced

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

master db2b5e784b 1/4: Make compat macro mh-display-completion-list obso


From: Stefan Kangas
Subject: master db2b5e784b 1/4: Make compat macro mh-display-completion-list obsolete
Date: Sat, 6 Aug 2022 15:23:43 -0400 (EDT)

branch: master
commit db2b5e784b2031f788af455f7056015bd15ce719
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Make compat macro mh-display-completion-list obsolete
    
    * lisp/mh-e/mh-compat.el (mh-display-completion-list): Make compat
    macro obsolete.  Update callers.
---
 lisp/mh-e/mh-compat.el |  1 +
 lisp/mh-e/mh-letter.el | 21 +++++++++++----------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 7a09429e4e..27158fc53a 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -69,6 +69,7 @@ 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."
+  (declare (obsolete nil "29.1"))
   `(display-completion-list
     (completion-hilit-commonality ,completions
                                   ,(length common-substring) nil)))
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index 4e3e101231..78355101c1 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -864,16 +864,17 @@ Any match found replaces the text from BEGIN to END."
           ((stringp completion)
            (if (equal word completion)
                (with-output-to-temp-buffer completions-buffer
-                 (mh-display-completion-list
-                  (all-completions word choices)
-                  ;; The `common-substring' arg only works if it's a prefix.
-                  (unless (and (functionp choices)
-                               (let ((bounds
-                                      (funcall choices
-                                               word nil '(boundaries . ""))))
-                                 (and (eq 'boundaries (car-safe bounds))
-                                      (< 0 (cadr bounds)))))
-                    word)))
+                 (display-completion-list
+                  (completion-hilit-commonality
+                   (all-completions word choices)
+                   ;; The `common-substring' arg only works if it's a prefix.
+                   (unless (and (functionp choices)
+                                (let ((bounds
+                                       (funcall choices
+                                                word nil '(boundaries . ""))))
+                                  (and (eq 'boundaries (car-safe bounds))
+                                       (< 0 (cadr bounds)))))
+                     word))))
              (ignore-errors
                (kill-buffer completions-buffer))
              (delete-region begin end)



reply via email to

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