diff options
| author | Stefan Monnier | 2009-11-25 06:02:01 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-11-25 06:02:01 +0000 |
| commit | e2d4ea5aba359bdd3074ada855df03ca07728bd2 (patch) | |
| tree | e057a4032960839df6a8039266f764f348c72f31 | |
| parent | 5f24557b126b05f314cb3a548fe2fbfd09d017ff (diff) | |
| download | emacs-e2d4ea5aba359bdd3074ada855df03ca07728bd2.tar.gz emacs-e2d4ea5aba359bdd3074ada855df03ca07728bd2.zip | |
(mail-abbrev-complete-alias): Use completion-in-region.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/mail/mailabbrev.el | 27 |
2 files changed, 9 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 92f0ed538fe..002a04641b7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2009-11-25 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2009-11-25 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * mail/mailabbrev.el (mail-abbrev-complete-alias): | ||
| 4 | Use completion-in-region. | ||
| 5 | |||
| 3 | * dabbrev.el (dabbrev--minibuffer-origin): Use minibuffer-selected-window. | 6 | * dabbrev.el (dabbrev--minibuffer-origin): Use minibuffer-selected-window. |
| 4 | (dabbrev-completion): Use completion-in-region. | 7 | (dabbrev-completion): Use completion-in-region. |
| 5 | (dabbrev--abbrev-at-point): Simplify regexp. | 8 | (dabbrev--abbrev-at-point): Simplify regexp. |
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index b0d77217dcb..08f7b37b630 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el | |||
| @@ -569,27 +569,12 @@ of a mail alias. The value is set up, buffer-local, when first needed.") | |||
| 569 | ;; Based on lisp.el:lisp-complete-symbol | 569 | ;; Based on lisp.el:lisp-complete-symbol |
| 570 | (interactive) | 570 | (interactive) |
| 571 | (mail-abbrev-make-syntax-table) | 571 | (mail-abbrev-make-syntax-table) |
| 572 | (let* ((end (point)) | 572 | (let ((end (point)) |
| 573 | (beg (with-syntax-table mail-abbrev-syntax-table | 573 | (beg (with-syntax-table mail-abbrev-syntax-table |
| 574 | (save-excursion | 574 | (save-excursion |
| 575 | (backward-word 1) | 575 | (backward-word 1) |
| 576 | (point)))) | 576 | (point))))) |
| 577 | (alias (buffer-substring beg end)) | 577 | (completion-in-region beg end mail-abbrevs))) |
| 578 | (completion (try-completion alias mail-abbrevs))) | ||
| 579 | (cond ((eq completion t) | ||
| 580 | (message "%s" alias)) ; confirm | ||
| 581 | ((null completion) | ||
| 582 | (error "[Can't complete \"%s\"]" alias)) ; (message ...) (ding) | ||
| 583 | ((not (string= completion alias)) | ||
| 584 | (delete-region beg end) | ||
| 585 | (insert completion)) | ||
| 586 | (t (with-output-to-temp-buffer "*Completions*" | ||
| 587 | (display-completion-list | ||
| 588 | (prog2 | ||
| 589 | (message "Making completion list...") | ||
| 590 | (all-completions alias mail-abbrevs) | ||
| 591 | (message "Making completion list...done")) | ||
| 592 | alias)))))) | ||
| 593 | 578 | ||
| 594 | (defun mail-abbrev-next-line (&optional arg) | 579 | (defun mail-abbrev-next-line (&optional arg) |
| 595 | "Expand a mail abbrev before point, then move vertically down ARG lines. | 580 | "Expand a mail abbrev before point, then move vertically down ARG lines. |