aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/message.el69
2 files changed, 43 insertions, 31 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 23fa5f7e828..045cb221b26 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12009-12-02 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * message.el (message-completion-in-region): New compatibility function.
4 (message-expand-group): Use it.
5
12009-12-02 Katsumi Yamaoka <yamaoka@jpl.org> 62009-12-02 Katsumi Yamaoka <yamaoka@jpl.org>
2 7
3 * gnus-group.el (gnus-group-prepare-flat): Check also whether groups 8 * gnus-group.el (gnus-group-prepare-flat): Check also whether groups
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 3f529047d29..eccb27296e3 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -7712,37 +7712,44 @@ those headers."
7712 (point)) 7712 (point))
7713 (skip-chars-backward "^, \t\n") (point)))) 7713 (skip-chars-backward "^, \t\n") (point))))
7714 (completion-ignore-case t) 7714 (completion-ignore-case t)
7715 (string (buffer-substring b (progn (skip-chars-forward "^,\t\n ") 7715 (e (progn (skip-chars-forward "^,\t\n ") (point)))
7716 (point)))) 7716 (hashtb (and (boundp 'gnus-active-hashtb) gnus-active-hashtb)))
7717 (hashtb (and (boundp 'gnus-active-hashtb) gnus-active-hashtb)) 7717 (message-completion-in-region e b hashtb)))
7718 (completions (all-completions string hashtb)) 7718
7719 comp) 7719(defalias 'message-completion-in-region
7720 (delete-region b (point)) 7720 (if (fboundp 'completion-in-region)
7721 (cond 7721 'completion-in-region
7722 ((= (length completions) 1) 7722 (lambda (e b hashtb)
7723 (if (string= (car completions) string) 7723 (let* ((string (buffer-substring b e))
7724 (progn 7724 (completions (all-completions string hashtb))
7725 (insert string) 7725 comp)
7726 (message "Only matching group")) 7726 (delete-region b (point))
7727 (insert (car completions)))) 7727 (cond
7728 ((and (setq comp (try-completion string hashtb)) 7728 ((= (length completions) 1)
7729 (not (string= comp string))) 7729 (if (string= (car completions) string)
7730 (insert comp)) 7730 (progn
7731 (t 7731 (insert string)
7732 (insert string) 7732 (message "Only matching group"))
7733 (if (not comp) 7733 (insert (car completions))))
7734 (message "No matching groups") 7734 ((and (setq comp (try-completion string hashtb))
7735 (save-selected-window 7735 (not (string= comp string)))
7736 (pop-to-buffer "*Completions*") 7736 (insert comp))
7737 (buffer-disable-undo) 7737 (t
7738 (let ((buffer-read-only nil)) 7738 (insert string)
7739 (erase-buffer) 7739 (if (not comp)
7740 (let ((standard-output (current-buffer))) 7740 (message "No matching groups")
7741 (message-display-completion-list (sort completions 'string<) 7741 (save-selected-window
7742 string)) 7742 (pop-to-buffer "*Completions*")
7743 (setq buffer-read-only nil) 7743 (buffer-disable-undo)
7744 (goto-char (point-min)) 7744 (let ((buffer-read-only nil))
7745 (delete-region (point) (progn (forward-line 3) (point)))))))))) 7745 (erase-buffer)
7746 (let ((standard-output (current-buffer)))
7747 (message-display-completion-list (sort completions 'string<)
7748 string))
7749 (setq buffer-read-only nil)
7750 (goto-char (point-min))
7751 (delete-region (point)
7752 (progn (forward-line 3) (point))))))))))))
7746 7753
7747(defun message-expand-name () 7754(defun message-expand-name ()
7748 (cond ((and (memq 'eudc message-expand-name-databases) 7755 (cond ((and (memq 'eudc message-expand-name-databases)