From: Bill Wohler Date: Mon, 17 Oct 2005 06:33:31 +0000 (+0000) Subject: (mh-display-completion-list-compat): New macro which calls X-Git-Tag: emacs-pretest-22.0.90~6564 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=79af55a7ebdbe2f431851d96f38fbca08f7fe82c;p=emacs.git (mh-display-completion-list-compat): New macro which calls `display-completion-list' correctly in older environments. Versions of Emacs prior to version 22 lacked a COMMON-SUBSTRING argument. (mh-complete-word): Use it. --- diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 89f257ed2a3..53c562c86a0 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,5 +1,11 @@ 2005-10-16 Bill Wohler + * mh-comp.el (mh-display-completion-list-compat): New macro which + calls `display-completion-list' correctly in older environments. + Versions of Emacs prior to version 22 lacked a COMMON-SUBSTRING + argument. + (mh-complete-word): Use it. + * mh-init.el (mh-image-load-path): Use locate-library to find MH-E. This simplified the code a lot. Flattened out nested statements even more. diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index 2aec8e8df9a..753f4ad50aa 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -1633,6 +1633,16 @@ This is useful in breaking up paragraphs in replies." (mh-do-in-xemacs (defvar mail-abbrevs)) +(defmacro mh-display-completion-list-compat (word choices) + "Completes WORD from CHOICES using `display-completion-list'. +Calls `display-completion-list' correctly in older environments. +Versions of Emacs prior to version 22 lacked a COMMON-SUBSTRING argument +which is used to highlight the next possible character you can enter +in the current list of completions." + (if (>= emacs-major-version 22) + `(display-completion-list (all-completions ,word ,choices) ,word) + `(display-completion-list (all-completions ,word ,choices)))) + ;;;###mh-autoload (defun mh-complete-word (word choices begin end) "Complete WORD at from CHOICES. @@ -1650,8 +1660,7 @@ Any match found replaces the text from BEGIN to END." ((stringp completion) (if (equal word completion) (with-output-to-temp-buffer completions-buffer - (display-completion-list (all-completions word choices) - word)) + (mh-display-completion-list-compat word choices)) (ignore-errors (kill-buffer completions-buffer)) (delete-region begin end)