diff options
| author | Bill Wohler | 2005-10-17 06:33:31 +0000 |
|---|---|---|
| committer | Bill Wohler | 2005-10-17 06:33:31 +0000 |
| commit | 79af55a7ebdbe2f431851d96f38fbca08f7fe82c (patch) | |
| tree | 1f4761bd4d9bbba51739e7640b105ebfe5f7e9e7 | |
| parent | 790401011b97425bcd08a8bb43a798f6eb69d5fa (diff) | |
| download | emacs-79af55a7ebdbe2f431851d96f38fbca08f7fe82c.tar.gz emacs-79af55a7ebdbe2f431851d96f38fbca08f7fe82c.zip | |
(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.
| -rw-r--r-- | lisp/mh-e/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/mh-e/mh-comp.el | 13 |
2 files changed, 17 insertions, 2 deletions
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 @@ | |||
| 1 | 2005-10-16 Bill Wohler <wohler@newt.com> | 1 | 2005-10-16 Bill Wohler <wohler@newt.com> |
| 2 | 2 | ||
| 3 | * mh-comp.el (mh-display-completion-list-compat): New macro which | ||
| 4 | calls `display-completion-list' correctly in older environments. | ||
| 5 | Versions of Emacs prior to version 22 lacked a COMMON-SUBSTRING | ||
| 6 | argument. | ||
| 7 | (mh-complete-word): Use it. | ||
| 8 | |||
| 3 | * mh-init.el (mh-image-load-path): Use locate-library to find | 9 | * mh-init.el (mh-image-load-path): Use locate-library to find |
| 4 | MH-E. This simplified the code a lot. Flattened out nested | 10 | MH-E. This simplified the code a lot. Flattened out nested |
| 5 | statements even more. | 11 | 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." | |||
| 1633 | 1633 | ||
| 1634 | (mh-do-in-xemacs (defvar mail-abbrevs)) | 1634 | (mh-do-in-xemacs (defvar mail-abbrevs)) |
| 1635 | 1635 | ||
| 1636 | (defmacro mh-display-completion-list-compat (word choices) | ||
| 1637 | "Completes WORD from CHOICES using `display-completion-list'. | ||
| 1638 | Calls `display-completion-list' correctly in older environments. | ||
| 1639 | Versions of Emacs prior to version 22 lacked a COMMON-SUBSTRING argument | ||
| 1640 | which is used to highlight the next possible character you can enter | ||
| 1641 | in the current list of completions." | ||
| 1642 | (if (>= emacs-major-version 22) | ||
| 1643 | `(display-completion-list (all-completions ,word ,choices) ,word) | ||
| 1644 | `(display-completion-list (all-completions ,word ,choices)))) | ||
| 1645 | |||
| 1636 | ;;;###mh-autoload | 1646 | ;;;###mh-autoload |
| 1637 | (defun mh-complete-word (word choices begin end) | 1647 | (defun mh-complete-word (word choices begin end) |
| 1638 | "Complete WORD at from CHOICES. | 1648 | "Complete WORD at from CHOICES. |
| @@ -1650,8 +1660,7 @@ Any match found replaces the text from BEGIN to END." | |||
| 1650 | ((stringp completion) | 1660 | ((stringp completion) |
| 1651 | (if (equal word completion) | 1661 | (if (equal word completion) |
| 1652 | (with-output-to-temp-buffer completions-buffer | 1662 | (with-output-to-temp-buffer completions-buffer |
| 1653 | (display-completion-list (all-completions word choices) | 1663 | (mh-display-completion-list-compat word choices)) |
| 1654 | word)) | ||
| 1655 | (ignore-errors | 1664 | (ignore-errors |
| 1656 | (kill-buffer completions-buffer)) | 1665 | (kill-buffer completions-buffer)) |
| 1657 | (delete-region begin end) | 1666 | (delete-region begin end) |