]> git.eshelyaron.com Git - emacs.git/commitdiff
(mail-abbrev-complete-alias): Use completion-in-region.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 25 Nov 2009 06:02:01 +0000 (06:02 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 25 Nov 2009 06:02:01 +0000 (06:02 +0000)
lisp/ChangeLog
lisp/mail/mailabbrev.el

index 92f0ed538fe0b70d8082f5d53c9d621a1dd08fd5..002a04641b766c746a4703da12a9795e2bfb6cc9 100644 (file)
@@ -1,5 +1,8 @@
 2009-11-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * mail/mailabbrev.el (mail-abbrev-complete-alias):
+       Use completion-in-region.
+
        * dabbrev.el (dabbrev--minibuffer-origin): Use minibuffer-selected-window.
        (dabbrev-completion): Use completion-in-region.
        (dabbrev--abbrev-at-point): Simplify regexp.
index b0d77217dcbea67e206f214f0049ed84a8d00ae3..08f7b37b6305647dfb2445c4aeeb8b165457cd7e 100644 (file)
@@ -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.