summaryrefslogtreecommitdiff
path: root/lisp/mail/mailabbrev.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2009-11-25 06:02:01 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2009-11-25 06:02:01 +0000
commite2d4ea5aba359bdd3074ada855df03ca07728bd2 (patch)
treee057a4032960839df6a8039266f764f348c72f31 /lisp/mail/mailabbrev.el
parent5f24557b126b05f314cb3a548fe2fbfd09d017ff (diff)
downloademacs-e2d4ea5aba359bdd3074ada855df03ca07728bd2.tar.gz
(mail-abbrev-complete-alias): Use completion-in-region.
Diffstat (limited to 'lisp/mail/mailabbrev.el')
-rw-r--r--lisp/mail/mailabbrev.el27
1 files changed, 6 insertions, 21 deletions
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.")
;; Based on lisp.el:lisp-complete-symbol
(interactive)
(mail-abbrev-make-syntax-table)
- (let* ((end (point))
- (beg (with-syntax-table mail-abbrev-syntax-table
- (save-excursion
- (backward-word 1)
- (point))))
- (alias (buffer-substring beg end))
- (completion (try-completion alias mail-abbrevs)))
- (cond ((eq completion t)
- (message "%s" alias)) ; confirm
- ((null completion)
- (error "[Can't complete \"%s\"]" alias)) ; (message ...) (ding)
- ((not (string= completion alias))
- (delete-region beg end)
- (insert completion))
- (t (with-output-to-temp-buffer "*Completions*"
- (display-completion-list
- (prog2
- (message "Making completion list...")
- (all-completions alias mail-abbrevs)
- (message "Making completion list...done"))
- alias))))))
+ (let ((end (point))
+ (beg (with-syntax-table mail-abbrev-syntax-table
+ (save-excursion
+ (backward-word 1)
+ (point)))))
+ (completion-in-region beg end mail-abbrevs)))
(defun mail-abbrev-next-line (&optional arg)
"Expand a mail abbrev before point, then move vertically down ARG lines.